comefrom: <awangdev>72. Edit Distance_5.java
code: public int minDistance(String word1, String word2) {
          if (word1 == null && word2 == null) {
              return 0;
          }
          char[] words1 = word1 == null ? new char[0] : word1.toCharArray();
          char[] words2 = word2 == null ? new char[0] : word2.toCharArray();
          
          int m = word1.length();
          int n = word2.length();
          int[][] dp = new int[2][n + 1];
          int curr = 0;
          int prev = 0;
           
          for (int i = 0; i <= m; i++) {
              prev = curr;
              curr = 1 - prev;
              for (int j = 0; j <= n; j++) {
                  if (i == 0) {
                      dp[curr][j] = j;
                      continue;
                  }
                  if (j == 0) {
                      dp[curr][j] = i;
                      continue;
                  }
  				dp[curr][j] = Math.min(dp[prev][j - 1], Math.min(dp[curr][j - 1], dp[prev][j])) + 1;
                  if (words1[i - 1] == words2[j - 1]) {
                      dp[curr][j] = Math.min(dp[curr][j], dp[prev][j - 1]);
                  }
              }
          }
          return dp[curr][n];
      }
masked: public int sample_funcname ( String var_0 , String var_1 ) {
    if ( var_0 == null && var_1 == null ) {
      return 0 ;
    }
    char [ ] var_2 = var_0 == null ? new char [ 0 ] : var_0 . toCharArray ( ) ;
    char [ ] var_3 = var_1 == null ? new char [ 0 ] : var_1 . toCharArray ( ) ;
    int var_4 = var_0 . length ( ) ;
    int var_5 = var_1 . length ( ) ;
    int [ ] [ ] var_6 = new int [ 2 ] [ var_5 + 1 ] ;
    int var_7 = 0 ;
    int var_8 = 0 ;
    for ( int var_9 = 0 ;
    var_9 <= var_4 ;
    var_9 ++ ) {
      var_8 = var_7 ;
      var_7 = 1 - var_8 ;
      for ( int var_10 = 0 ;
      var_10 <= var_5 ;
      var_10 ++ ) {
        if ( var_9 == 0 ) {
          var_6 [ var_7 ] [ var_10 ] = var_10 ;
          continue ;
        }
        if ( var_10 == 0 ) {
          var_6 [ var_7 ] [ var_10 ] = var_9 ;
          continue ;
        }
        var_6 [ var_7 ] [ var_10 ] = Math . min ( var_6 [ var_8 ] [ var_10 - 1 ] , Math . min ( var_6 [ var_7 ] [ var_10 - 1 ] , var_6 [ var_8 ] [ var_10 ] ) ) + 1 ;
        if ( var_2 [ var_9 - 1 ] == var_3 [ var_10 - 1 ] ) {
          var_6 [ var_7 ] [ var_10 ] = Math . min ( var_6 [ var_7 ] [ var_10 ] , var_6 [ var_8 ] [ var_10 - 1 ] ) ;
        }
      }
    }
    return var_6 [ var_7 ] [ var_5 ] ;
  }
  