EPAM Systems interview question

easy to medium dsa question