0
2
1
9
7
1
2
0
3
2
0

The first and last non-zeroes in the above are highlighted. The result should be 9, yet your formula returns 2.

Regards