Max circular sum

please point out my mistakes here is the code

bro would u want to explain the logic u are trying to use here.
its quite unclear by looking at the code

if u want my part of explanation that is the standard one I can provide u
comment below