EPAM Systems interview question

they asked basic to medium level leetcode