(Also a subtle off-by-one error, it should be 0 to |n|-1 and i to |n|-1.)
Thanks for catching the reverse. I was aware of the off by one but thought the “to” operator I invented would be exclusive of the second operand (kinda like range in Python) :)
1 point for having a good reply. 100 points for doing it in code. Well done!