Circular sum Problem

I am not able to approach the problem properly
Here is the link:-https://ide.codingblocks.com/s/80372

Here, you have to considered the given array as a circular sequence.
example:
for the array : {-1,2,8,-5,6}
the sub-sequences are:
{-1}=-1
{-1,2} = 1(sum)
{-1,2,8} = 9
{-1,2,8,-5}= 4
{-1,2,8,-5,6} = 10
{2]=2
{2,8} = 10
{2,8,-5}=5
…
…
{6}=6
{6,-1}=5 (coz array is considered circular)
{6,-1,2} =7
…
print the maximum.

First, create a program with nested loop, with complexity O(N)
this would help you understand the approach.
then, try to reduce the complexity to O(N)

If you still face problem, feel free to ask