Doubt in problem statement

You are provided n numbers (both +ve and -ve). Numbers are arranged in a circular form. You need to find the maximum sum of consecutive numbers.

This is the problem statement. Now what does it mean by the circular form ?

circular means after last index next index will be 0

The elements which contribute to the maximum sum are arranged such that wrapping is there. Examples: {10, -12, 11}, {12, -5, 4, -8, 11}.

in case of 10-12 11
max cirular sum is 11+10=21
in case of 12 -5 4 -8 11
max circular sum is 4-8+11+12=19

1 Like