Domanda di colloquio di Microsoft

Was stuck in coding test, cause misunderstand the questions.