EPAM Systems Interview Question

easy to medium dsa question