Pergunta de entrevista da empresa AKUNA CAPITAL

coding problem was one about heaps