For example, if I have a sorted array 

```
{1,1,1,1,1,4,5}

```

and I want to know the rightmost index of `1`, is there a function that will allow me to do that? (Apart from reverse sorting the array)