getting the correct answer on compile against the custom input, but getting the wrong answer on submission.
please help to figure out the bug.
My code:
getting the correct answer on compile against the custom input, but getting the wrong answer on submission.
please help to figure out the bug.
My code:
please reply! Itβs been 12 hrs.
Hey @swastikswarupmeher , Sorry for the delay my network was not working . Looking into your solution now .
Hey @swastikswarupmeher , the logi you are using is correct but you are changing the median inside the if and else condition itself . Also so much of conditions are not required . you only need to balance the heaps if the difference between them is 2 otherwise you just have to push it into one of the heaps .
Here is a more clear code to help you understand . I hope it helps !
Happy coding!
Mark your doubt as resolved if you have no further queries .