I tried to solve the question using modified kadane’s algo (so that it takes all negative number case too) it’s working fine with all the cases I’m entering but it’s not passing any case when I submit my code. I tried to rectify it but nothing helped.
Here’s the code: