I hope, you are aware that you are searching backwards. The result will be (maybe) unexpected if your array contains two 10s.