how do we print subarray in kadane"s algo?
Printing subarray
You can take 4 pointers.
2 points to maximum sum subarray, while other 2 point to current subarray.
After running the algo you can easily print the subarray using the 2 pointers.
how do we print subarray in kadane"s algo?
You can take 4 pointers.
2 points to maximum sum subarray, while other 2 point to current subarray.
After running the algo you can easily print the subarray using the 2 pointers.