title: Ceiling In A Sorted Array
signature: ceiling_in_a_sorted_array <- function(arr, low, high, x) {
source_py: def ceiling_in_a_sorted_array(arr, low, high, x):
      if (x <= arr[low]):
          return low
      i = low
      for i in range(high):
          if (arr[i] == x):
              return i
          if ((arr[i] < x) and (arr[(i + 1)] >= x)):
              return (i + 1)
      return (- 1)
source_cpp: int ceiling_in_a_sorted_array(vector<int> arr, int low, int high, int x) {
    int i;
    if ( x <= arr [ low ] ) return low;
    for ( i = low;
    i < high;
    i ++ ) {
      if ( arr [ i ] == x ) return i;
      if ( arr [ i ] < x && arr [ i + 1 ] >= x ) return i + 1;
    }
    return - 1;
  }