Domanda di colloquio di Meta

some questions regarding heap, time complexity, space complexity