Domanda di colloquio di DBS Bank

Coding question and how to solve the question