title: Find The Minimum Distance Between Two Numbers 1
signature: findTheMinimumDistanceBetweenTwoNumbers1 :: [Integer] -> Integer -> Integer -> Integer -> Integer
  findTheMinimumDistanceBetweenTwoNumbers1 arr n x y = 
source_py: def find_the_minimum_distance_between_two_numbers_1(arr, n, x, y):
      min_dist = sys.maxsize
      for i in range(n):
          if ((arr[i] == x) or (arr[i] == y)):
              prev = i
              break
      while (i < n):
          if ((arr[i] == x) or (arr[i] == y)):
              if ((arr[prev] != arr[i]) and ((i - prev) < min_dist)):
                  min_dist = (i - prev)
                  prev = i
              else:
                  prev = i
          i += 1
      return min_dist
source_cpp: int find_the_minimum_distance_between_two_numbers_1(vector<int> arr, int n, int x, int y) {
    int i = 0;
    int min_dist = INT_MAX;
    int prev;
    for ( i = 0;
    i < n;
    i ++ ) {
      if ( arr [ i ] == x || arr [ i ] == y ) {
        prev = i;
        break;
      }
    }
    for (;
    i < n;
    i ++ ) {
      if ( arr [ i ] == x || arr [ i ] == y ) {
        if ( arr [ prev ] != arr [ i ] && ( i - prev ) < min_dist ) {
          min_dist = i - prev;
          prev = i;
        }
        else prev = i;
      }
    }
    return min_dist;
  }