In the sample input, the given array contains
8 -8 9 -9 10 -11 12
but in the sample output, the element β-11β is nowhere used to find the maximum sum. So can you please clarify whether the problem is in the sample output or I made a mistake in understanding the question?