Hopper Interview Question

Solve this problem on some terrible online IDE