Domanda di colloquio di Pinwheel (NY)

Practical coding question in the range of LC medium difficulty