Question d’entretien chez Pinwheel (NY)

Practical coding question in the range of LC medium difficulty