How to do it get the last non zero value of an array?