Kadane algorithm: how to get start and end index for the maximum sum subarray

Please explain how to modify this code to get the start and end index of the maximum sum subarray as in the iterative and cumulative approaches.

hello @mangeshjsh78
To print the subarray with the maximum sum, we maintain indices whenever we get the maximum sum.