find the next right index that's larger than current element in array