comefrom: <awangdev>10. Regular Expression Matching_1.java
code: public boolean isMatch(String s, String p) {
          if (s == null || p == null) return false;
          int m = s.length(), n = p.length();
          boolean[][] dp = new boolean[m + 1][n + 1];
          char[] ss = s.toCharArray();
          char[] pp = p.toCharArray();
          
          for (int i = 0; i <= m; i++) {
              for (int j = 0; j <= n; j++) {
                  if (i == 0 && j == 0) {
                      dp[i][j] = true;
                      continue;
                  }
                  if (j == 0) { 
                      dp[i][j] = false;
                      continue;
                  }
  
                  dp[i][j] = false;
                  if (pp[j - 1] != '*') {
                      if (i >= 1 && (ss[i - 1] == pp[j - 1] || pp[j - 1] == '.')) {
                          dp[i][j] = dp[i - 1][j - 1];
                      }
                  } else { 
                      if (j >= 2 ) { 
                          dp[i][j] |= dp[i][j - 2];
                      }
                      if (j >= 2 && i >= 1 && (ss[i - 1] == pp[j - 2] || pp[j - 2] == '.')) { 
                          dp[i][j] |= dp[i - 1][j];
                      }
                  }
              }
          }
          return dp[m][n];
      }
masked: public boolean var_0 ( String var_1 , String var_2 ) {
    if ( var_1 == null || var_2 == null ) return false ;
    int var_3 = var_1 . length ( ) , var_4 = var_2 . length ( ) ;
    boolean [ ] [ ] var_5 = new boolean [ var_3 + 1 ] [ var_4 + 1 ] ;
    char [ ] var_6 = var_1 . toCharArray ( ) ;
    char [ ] var_7 = var_2 . toCharArray ( ) ;
    for ( int var_8 = 0 ;
    var_8 <= var_3 ;
    var_8 ++ ) {
      for ( int var_9 = 0 ;
      var_9 <= var_4 ;
      var_9 ++ ) {
        if ( var_8 == 0 && var_9 == 0 ) {
          var_5 [ var_8 ] [ var_9 ] = true ;
          continue ;
        }
        if ( var_9 == 0 ) {
          var_5 [ var_8 ] [ var_9 ] = false ;
          continue ;
        }
        var_5 [ var_8 ] [ var_9 ] = false ;
        if ( var_7 [ var_9 - 1 ] != '*' ) {
          if ( var_8 >= 1 && ( var_6 [ var_8 - 1 ] == var_7 [ var_9 - 1 ] || var_7 [ var_9 - 1 ] == '.' ) ) {
            var_5 [ var_8 ] [ var_9 ] = var_5 [ var_8 - 1 ] [ var_9 - 1 ] ;
          }
        }
        else {
          if ( var_9 >= 2 ) {
            var_5 [ var_8 ] [ var_9 ] |= var_5 [ var_8 ] [ var_9 - 2 ] ;
          }
          if ( var_9 >= 2 && var_8 >= 1 && ( var_6 [ var_8 - 1 ] == var_7 [ var_9 - 2 ] || var_7 [ var_9 - 2 ] == '.' ) ) {
            var_5 [ var_8 ] [ var_9 ] |= var_5 [ var_8 - 1 ] [ var_9 ] ;
          }
        }
      }
    }
    return var_5 [ var_3 ] [ var_4 ] ;
  }
  