comefrom: <awangdev>64. Minimum Path Sum_4.java
code: public int minPathSum(int[][] grid) {
          if (grid == null || grid.length == 0 || grid[0] == null || grid[0].length == 0) return 0;
          int m = grid.length, n = grid[0].length;
          int[][] dp = new int[2][n];
  
          for (int i = 0; i < m; i++) {
              for (int j = 0; j < n; j++) {
                  dp[i%2][j] = grid[i][j]; 
                  if (i == 0 && j == 0) continue;    
                  if (i == 0 && j > 0) dp[i%2][j] += dp[i%2][j - 1];
                  else if (i > 0 && j == 0) dp[i%2][j] += dp[(i - 1)%2][j];
                  else dp[i%2][j] += Math.min(dp[(i - 1)%2][j], dp[i%2][j - 1]); 
              }
          }
          return dp[(m - 1)%2][n - 1];
      }
masked: 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 ;
    int var_1 = var_0 . length , var_2 = var_0 [ 0 ] . length ;
    int [ ] [ ] var_3 = new int [ 2 ] [ var_2 ] ;
    for ( int var_4 = 0 ;
    var_4 < var_1 ;
    var_4 ++ ) {
      for ( int var_5 = 0 ;
      var_5 < var_2 ;
      var_5 ++ ) {
        var_3 [ var_4 % 2 ] [ var_5 ] = var_0 [ var_4 ] [ var_5 ] ;
        if ( var_4 == 0 && var_5 == 0 ) continue ;
        if ( var_4 == 0 && var_5 > 0 ) var_3 [ var_4 % 2 ] [ var_5 ] += var_3 [ var_4 % 2 ] [ var_5 - 1 ] ;
        else if ( var_4 > 0 && var_5 == 0 ) var_3 [ var_4 % 2 ] [ var_5 ] += var_3 [ ( var_4 - 1 ) % 2 ] [ var_5 ] ;
        else var_3 [ var_4 % 2 ] [ var_5 ] += Math . min ( var_3 [ ( var_4 - 1 ) % 2 ] [ var_5 ] , var_3 [ var_4 % 2 ] [ var_5 - 1 ] ) ;
      }
    }
    return var_3 [ ( var_1 - 1 ) % 2 ] [ var_2 - 1 ] ;
  }
  