Coding Blocks interview question

DSA question on Priority Queue