Kadane algorithm

Link to my code

why this code is not passing all the test cases,
though it is showing correct answer for the given test case

@Gurjot
You were not reseting max_sum and sum after each test case.
corrected code:

Do we need to specify the no of test cases, the range of numbers in the array and value of n

@Gurjot
no, that was unnecessary.