The test cases aren’t passing eventhough it shows correct output in the IDE. I have even taken care of the overflow if any. Please Check.
link: https://ide.codingblocks.com/s/262993
Test cases not passing
hello @rmukhopadhyay_be17

here u pushing d everytime .
but u missed one case where we should not push d.
the case is maxheap.size()==k and d> maxheap.top()