Pregunta de entrevista de Appian

leetcode type technical question on heaps