title: Search An Element In An Array Where Difference Between Adjacent Elements Is 1
signature: def searchAnElementInAnArrayWhereDifferenceBetweenAdjacentElementsIs1(arr: List[Int], n: Int, x: Int) = {
source_py: def search_an_element_in_an_array_where_difference_between_adjacent_elements_is_1(arr, n, x):
      i = 0
      while (i < n):
          if (arr[i] == x):
              return i
          i = (i + abs((arr[i] - x)))
      print('number is not present!')
      return (- 1)
source_cpp: int search_an_element_in_an_array_where_difference_between_adjacent_elements_is_1(vector<int> arr, int n, int x) {
    int i = 0;
    while ( i < n ) {
      if ( arr [ i ] == x ) return i;
      i = i + abs ( arr [ i ] - x );
    }
    return - 1;
  }