Hopper interview question

Solve this problem on some terrible online IDE