title: Efficient Search In An Array Where Difference Between Adjacent Is 1
signature: efficientSearchInAnArrayWhereDifferenceBetweenAdjacentIs1 :: [Integer] -> Integer -> Integer -> Integer
  efficientSearchInAnArrayWhereDifferenceBetweenAdjacentIs1 arr n x = 
source_py: def efficient_search_in_an_array_where_difference_between_adjacent_is_1(arr, n, x):
      i = 0
      while (i <= (n - 1)):
          if (arr[i] == x):
              return i
          i += abs((arr[i] - x))
      return (- 1)
source_cpp: int efficient_search_in_an_array_where_difference_between_adjacent_is_1(vector<int> arr, int n, int x) {
    int i = 0;
    while ( i <= n - 1 ) {
      if ( arr [ i ] == x ) return i;
      i += abs ( arr [ i ] - x );
    }
    return - 1;
  }