Pergunta de entrevista da empresa Curiosity Gym

Write code to solve a puzzle.