Domanda di colloquio di Microsoft

Two problems with medium difficulty to solve