Kadane's algorithm

how to print the subarray which gives the maximum sum in kadane’s algo ,

We’ll just have to modify our already known code of kadane’s algorithm by maintaining maximum sum sub- array ending at each index of the array or we can just maintain the indices whenever we get the maximum sum. Post your code on the ide so I can show you.