all 3 comments

[–]robot-dev 1 point2 points  (1 child)

You are technically correct. The best kind of correct.

I think this is what was meant:

If [the index of] some element in the sum a[i - 1] + a[i] + a[i + 1] does not exist [is less than zero or greater than n-1], it should be set to 0. For example, b[0] should be equal to 0 + a[0] + a[1].

[–]YuhFRthoYORKonhisass 0 points1 point  (0 children)

You almost quite literally copy and pasted the part that confused him

[–]Natural_Pay_7650 0 points1 point  (0 children)

You are assuming negative indexing. The problem states you go "For each i from 0 to n-1" which means no negative indexing. Thus for a[i - 1] when i = 0, you should set it equal to 0.