EPAM Systems interview question

Two was coding question at the time of interview, asked on java, C++ and Python