Maximum subarray sum 2

i need detailed explanation with code line by line , please give me the link of this video code , and in the written code please add detailed comments line by line, what’s going on, its hard , so please write the comments in each and every step of the code and send it to me AS SOON AS POSSIBLE, this will help me a lot to understand , thankyou

Hey @shashank_sabharwal, there’s a simple algorithm called kadane’s algorithm to find the maximum sum subarray.
The logic is to find the cumulative sum of the array, when the cumulative sum turns negative we initialize it with zero because we are discarding the part seen till now and now the starting position of the subarray has been changed. Meanwhile, we are trying to maintain the maximum answer seen until now as well.
You can check out the code here. I strongly suggest to dry run the code on few test cases for better understanding.

i dont receive any link of code, its not present in your reply, and one more thing i know there is kadanes method but i am asking about the previous method the video before kadanes which was maximum subarray sum 2 , please explain the code of that video not of kadanes method

@yashwardhan gautam sir i am waiting for your reply kindly solve my query as soon as possible , thankyou

You can check this code.