code is fine but test case not passing
maybe constraints?
Merge sort doubt
added comments where code is updated
i didnt get this… s+ (e-s)/2 will avoid overflow
how can we write in place of (s+e)/2
can you please tell?
s+(e-s)/2
would expand to
(2*s+ e-s)/2
would furher simplify to
(s+e)/2
so both are the same things
its just that instead of adding we use a s+(e-s)/2 formula to avoid overflow
okay thanks a lot… i got it
btw all the test cases passed if we use (s+e)/2 also…
thanks for it
i was not able to submit using (s+e)/2
like my submission was not getting judged tried thrice
lol
Anyway good luck
yup it worked for me… tough luck
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.