Pergunta de entrevista da empresa Squarepoint Capital

Medium difficulty programming question from their HackerRank question bank