Am I wrong? Also, I am not able to understand how it is going for a TLE.
Can u plz help me out for which case i m getting wrong answer
I am getting wrong answer too
Yeah, you are right it is the same question. Thank you!
Check your Output for this test case
Your O/P is:
(This sums up to 75165824 which is wrong)
And my O/P is:
(This one sums up to 5e7)
Here is my code in Python using Heap.