Hopper interview question

Solve a medium-difficulty coding challenge