Domanda di colloquio di Microsoft

1 coding question which was pretty straight forward