Doubt in the sample output given in the question

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?

you have to find the maximum circular sum so circular sum means after last index you again come at 0th index. that is why we go from 12 to 10 12->8->…->10
so to solve this question you have to consider both the ways circular or without circular and at last take max of both

you have to use Kadane’s algorithm to solve this problem efficiently