title: what is the most efficient way to find the first element greater than a given number in an array for multiple queries?
body: <p>I have an array of numbers. My goal is to <strong>find the index of the first element</strong> which is greater than some value k while going from starting index towards right. </p>
  
  <p>For example, if array is A = [4 3 3 4 6 7 1] and k = 3 and starting index is 1 (0 based indexing) than the index of first number which is greater than k is 3.
  Similarly, if k = 3 and starting index = 0, then the index of first element is 0.</p>
  
  <p>Preprocessing is fine as I need to process multiple such queries for different values of k and starting indexes.</p>
  
  <p><strong>[Update]</strong> There could be some array update queries as well in between any "find first index" queries. For example, an update query of index=1 with value=2 would change A to [4 5 3 4 6 7 1]</p>