I have a case I think that needs to be handled in this question but it isnt

Well what we do is standing at idx i, I add my value to the previous best sum so far in the last block to mine … but what if the previous best sum so far is negative and I myself is positive … then in that case Would only I be answer for the same … but when I submitted code without this check that always including previous best sum so far … it got AC … I definately think this needs to be thought of

hello @prabh1601
yeah that can be a valid case ,in that case consider contribution of previous best as 0 (same as kadane algorithm).

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.