Curiosity Gym Interview Question

Write code to solve a puzzle.