Domanda di colloquio di Applied Intuition

Try to solve a program from leet code