title: How can I locate an index given the following constraints?
body: <blockquote>
    <p>Given an array of n integers A[0…n−1], such that ∀i,0≤i≤n, we have that |A[i]−A[i+1]|≤1, and if A[0]=x, A[n−1]=y, we have that x&lt;y. Locate the index j such that A[j]=z, for a given value of z, x≤ z ≤y</p>
  </blockquote>
  
  <p>I dont understand the problem. I've been stuck on it for 4 days. Any idea of how to approach it with binary search, exponential search or interpolation search recursively? We are given an element z find the index j such that a [j] = z (a j) am i right?.</p>