<qiyuangong>695_Max_Area_of_Island_1.java
public int maxAreaOfIsland(int[][] grid) {
        int[] dr = new int[]{1, -1, 0, 0};
        int[] dc = new int[]{0, 0, 1, -1};
        int ans = 0;
        for (int r0 = 0; r0 < grid.length; r0++) {
            for (int c0 = 0; c0 < grid[0].length; c0++) {
                if (grid[r0][c0] == 1) {
                    int shape = 0;
                    Stack<int[]> stack = new Stack();
                    stack.push(new int[]{r0, c0});
                    grid[r0][c0] = 0;
                    while (!stack.empty()) {
                        int[] node = stack.pop();
                        int r = node[0], c = node[1];
                        shape++;
                        for (int k = 0; k < 4; k++) {
                            int nr = r + dr[k];
                            int nc = c + dc[k];
                            if (0 <= nr && nr < grid.length &&
                                    0 <= nc && nc < grid[0].length &&
                                    grid[nr][nc] == 1) {
                                stack.push(new int[]{nr, nc});
                                grid[nr][nc] = 0;
                            }
                        }
                    }
                    ans = Math.max(ans, shape);
                }
            }
        }
        return ans;
    }
public int sample_funcname ( int [ ] [ ] var_0 ) {
  int [ ] var_3 = new int [ ] {
    1 , - 1 , 0 , 0 };
    int [ ] var_4 = new int [ ] {
      0 , 0 , 1 , - 1 };
      int var_5 = 0 ;
      for ( int var_6 = 0 ;
      var_6 < var_0 . length ;
      var_6 ++ ) {
        for ( int var_8 = 0 ;
        var_8 < var_0 [ 0 ] . length ;
        var_8 ++ ) {
          if ( var_0 [ var_6 ] [ var_8 ] == 1 ) {
            int var_9 = 0 ;
            Stack < int [ ] > var_11 = new Stack ( ) ;
            var_11 . push ( new int [ ] {
              var_6 , var_8 }
              ) ;
              var_0 [ var_6 ] [ var_8 ] = 0 ;
              while ( ! var_11 . empty ( ) ) {
                int [ ] var_15 = var_11 . pop ( ) ;
                int var_16 = var_15 [ 0 ] , var_17 = var_15 [ 1 ] ;
                var_9 ++ ;
                for ( int var_18 = 0 ;
                var_18 < 4 ;
                var_18 ++ ) {
                  int var_20 = var_16 + var_3 [ var_18 ] ;
                  int var_21 = var_17 + var_4 [ var_18 ] ;
                  if ( 0 <= var_20 && var_20 < var_0 . length && 0 <= var_21 && var_21 < var_0 [ 0 ] . length && var_0 [ var_20 ] [ var_21 ] == 1 ) {
                    var_11 . push ( new int [ ] {
                      var_20 , var_21 }
                      ) ;
                      var_0 [ var_20 ] [ var_21 ] = 0 ;
                    }
                  }
                }
                var_5 = Math . max ( var_5 , var_9 ) ;
              }
            }
          }
          return var_5 ;
        }
        