Pregunta de entrevista de AKUNA CAPITAL

coding problem was one about heaps