in reply to Find last position of an element in array

The array appears to be sorted. If that's the case, and if the array's very large, you might want to use a binary search. It would have to be larger to really benefit, though.

  • Comment on Re: Find last position of an element in array