You have this list
[7, 11, 0, 5, 6, 7]
And you iterate through its indices.
but you don’t look at the current one, you look at the previous one, so you’re really looking at this list:
[7, 7, 11, 0, 5, 6] # move last element to beginning
There can’t possibly be any point to that
I don’t see why you print the letter N, wouldn’t it be better to know which value N has?
If you’re trying to compare values pair-wise with the one that follows, why don’t you start with iterating through the following:
Note that this is one pass over the list, you would not be nesting loops inside each other
How does comparing elements to each other relate to the problem?
Again with the example input of all values being equal - this won’t tell you anything
[1, 1, 1, 1, 1] # this has a solution: 2
[1, 1, 1, 1] # this has no solution (-1)
The problem statement is about sums there is a condition to check at each position:
find an index N where
the sum of the integers to the left of N is equal to the sum of the integers to the right of N
So for each possible N, you should be testing whether:
the sum of the integers to the left of N
is equal to
the sum of the integers to the right of N