Hopper Interview Question

Simplified version of a problem that Hopper had to solve