C3 AI interview question

"Hard" level leetcode question about a heap