<awangdev>Russian Doll Envelopes_1.java
public int maxEnvelopes(int[][] envelopes) {
        if (envelopes == null || envelopes.length == 0 
           || envelopes[0] == null || envelopes[0].length == 0) {
            return 0;
        }
        Arrays.sort(envelopes, new Comparator<int[]>() {
            public int compare (int[] a, int[] b) {
                if (a[0] == b[0]) {
                    return a[1] - b[1];
                } else {
                    return a[0] - b[0];
                }
            }
        });
        
        int n = envelopes.length;
        int[] dp = new int[n];
        int max = 0;
        for (int i = 0; i < n; i++) {
            dp[i] = 1;
            for (int j = 0; j < i; j++) {
                if(envelopes[j][0] < envelopes[i][0] && envelopes[j][1] < envelopes[i][1]) {
                    dp[i] = Math.max(dp[i], dp[j] + 1);
                }
            }
            max = Math.max(max, dp[i]);
        }
        return max;
    }
public int sample_funcname ( int [ ] [ ] var_0 ) {
  if ( var_0 == null || var_0 . length == 0 || var_0 [ 0 ] == null || var_0 [ 0 ] . length == 0 ) {
    return 0 ;
  }
  Arrays . sort ( var_0 , new Comparator < int [ ] > ( ) {
    public int compare ( int [ ] var_8 , int [ ] var_9 ) {
      if ( var_8 [ 0 ] == var_9 [ 0 ] ) {
        return var_8 [ 1 ] - var_9 [ 1 ] ;
      }
      else {
        return var_8 [ 0 ] - var_9 [ 0 ] ;
      }
    }
  }
  ) ;
  int var_11 = var_0 . length ;
  int [ ] var_12 = new int [ var_11 ] ;
  int max = 0 ;
  for ( int var_14 = 0 ;
  var_14 < var_11 ;
  var_14 ++ ) {
    var_12 [ var_14 ] = 1 ;
    for ( int var_15 = 0 ;
    var_15 < var_14 ;
    var_15 ++ ) {
      if ( var_0 [ var_15 ] [ 0 ] < var_0 [ var_14 ] [ 0 ] && var_0 [ var_15 ] [ 1 ] < var_0 [ var_14 ] [ 1 ] ) {
        var_12 [ var_14 ] = Math . max ( var_12 [ var_14 ] , var_12 [ var_15 ] + 1 ) ;
      }
    }
    max = Math . max ( max , var_12 [ var_14 ] ) ;
  }
  return max ;
}
