I think it should start from 1 to n

Hello,

It seems like in this problem we need to traverse from 1 to n despite n to 1.

https://ide.codingblocks.com/s/233264 (1 to n)
https://ide.codingblocks.com/s/233256 (n to 1)