size of array : 3
array elements : 1 2 4
subarray with max sum is : 1 2 4
sum is : 7
This is the output when I use the code with Complexity O(N^3)
size of arra : 3
array elements : 1 2 4
subarray with max sum is : 2 4
sum is : 6
This is the output when I use the code with Complexity O(N^2)
why output is coming different?