Hello everybody! The above problem is a combinatorics problem I got wrong. :( This is ZIO $2006$, P$1$.
For the first part, I got as answer: $3$ which is wrong. What I did to try my value which I guessed was trial and error combined with the observations I made at every step. Notice that in the first sub-case, days 8 to 15 sum to $0$ and days 1 through 7 sum to 0. I got the maximum via days 10 through 14 which I thought would be the answer. After noting the answer to be $4$, I began my search for it by expanding to the west because the east has just a -1 which is useless. 3-4 = -1 hmm not useful and we move on, -1 + 2 = 1 that is still less, 1-1 = 0 which is even lesser and continuing. But because they (1 through 7) sum to $0$, the max sum is no more.
Also note that this way would be way longer and unexpected for the longer sub-cases (b) and (c) (provided that you're are given about 10 minutes for each sub-part). I researched and found out that there is something called a window-sliding technique but unfortunately it's for coders and this is a pen and paper exam. Although, I am pretty sure this question is either me just being so dumb or a silly.
The answers are $4,4,6$ respectively.
I would appreciate some easy to understand and easy to think-of in an exam solutions although they may be long and not the most elegant.
Any help would be appreciated. Thanks!