its confusing
pls clear
I didnt understand how the tutor printed the subarry using left and right
hello @suryansh771
it is simple.
we are using left and right to store starting and ending index of max sum subarray.
so while running kadane if we r encountring sum whose sum is greater than our existing max sum then we are updating our max sum and as well as left and right pointer .
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
The left and right variables are used as marker to store the starting point and the ending point of the maximum sum subarray(you found out while iterating the array).
Dry run it with an example and you will get how it is actually working
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.