Pergunta de entrevista da empresa BENlabs

A medium difficulty HackerRank problem