please attach sample test case for which my code isnt giving correct output.
if there is major error in approach please help me out with that too.
Cant find error
Follow the following steps:
- Apply kadane algorithm to find max subarray sum.
- Calculate the total sum of array.
- Make all the elements of array negative.
- Again apply kadane algorithm on array.
- Add the result in step 2 and step 4.
- Answer is max of step 5 and step 1.
i understand what are u saying but i dont know why my code isnt working.
atleast provide me any sample tc for which my algo is not working