Kadane's algorithm

Question link- https://practice.geeksforgeeks.org/problems/kadanes-algorithm/0#

Code link-

I am trying to submit but it fails.

hello @div_yanshu07

check now->

Hey, if I am not wrong the line you added is similar to the line I commented out right?
Because when the current sum becomes negative I make it 0.

yeah , but u should write that after updating ur maxsum