<awangdev>986. Interval List Intersections_1.java
public int[][] intervalIntersection(int[][] A, int[][] B) {
        List<int[]> list = new ArrayList<>();

        int i = 0, j = 0;
        int m = A.length, n = B.length;
        while (i < m && j < n) {
            int lo = Math.max(A[i][0], B[j][0]);
            int hi = Math.min(A[i][1], B[j][1]);
            if (lo <= hi) list.add(new int[]{lo, hi});
           
            if (A[i][1] < B[j][1]) i++;
            else j++;
        }
       
        int[][] rst = new int[list.size()][2];
        for (int k = 0; k < list.size(); k++) {
            rst[k] = list.get(k);
        }
       
        return rst;
    }
public int [ ] [ ] sample_funcname ( int [ ] [ ] var_0 , int [ ] [ ] var_1 ) {
  List < int [ ] > var_4 = new ArrayList < > ( ) ;
  int var_6 = 0 , var_7 = 0 ;
  int var_9 = var_0 . length , var_10 = var_1 . length ;
  while ( var_6 < var_9 && var_7 < var_10 ) {
    int var_13 = Math . max ( var_0 [ var_6 ] [ 0 ] , var_1 [ var_7 ] [ 0 ] ) ;
    int var_16 = Math . min ( var_0 [ var_6 ] [ 1 ] , var_1 [ var_7 ] [ 1 ] ) ;
    if ( var_13 <= var_16 ) var_4 . add ( new int [ ] {
      var_13 , var_16 }
      ) ;
      if ( var_0 [ var_6 ] [ 1 ] < var_1 [ var_7 ] [ 1 ] ) var_6 ++ ;
      else var_7 ++ ;
    }
    int [ ] [ ] var_20 = new int [ var_4 . size ( ) ] [ 2 ] ;
    for ( int var_21 = 0 ;
    var_21 < var_4 . size ( ) ;
    var_21 ++ ) {
      var_20 [ var_21 ] = var_4 . get ( var_21 ) ;
    }
    return var_20 ;
  }
  