Maximum sum query

Wrong answer

Hey @sk3657860
Your logic is incorrect. Your code return sum of given interval. You need to find max sum possible of any subarray in the given interval.
Look at this https://stackoverflow.com/questions/19524110/find-the-largest-sum-subarray-from-the-given-array-using-segment-trees

If your doubt is resolved please mark it as closed.

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.