EPAM Systems Interview Question

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