Nextbite interview question

Problem to solve on coderpad which involves using priority queues and heaps