Domanda di colloquio di Spotnana

Question related to priority queue and DP