public static int countMine ( int h , int w , int height , int width , String [ ] [ ] S ) {
  int count = 0 ;
  for ( int i = h - 1 ;
  i <= h + 1 ;
  i ++ ) {
    if ( i < 0 || i >= height ) {
      continue ;
    }
    for ( int j = w - 1 ;
    j <= w + 1 ;
    j ++ ) {
      if ( j < 0 || j >= width ) {
        continue ;
      }
      if ( S [ i ] [ j ] . equals ( "#" ) ) {
        count ++ ;
      }
    }
  }
  return count ;
}

public static int countMine ( int h , int w , int height , int width , String [ ] [ ] S ) { int count = 0 ; for ( int i = h - 1 ; i <= h + 1 ; i ++ ) { if ( i < 0 || i >= height ) { continue ; } for ( int j = w - 1 ; j <= w + 1 ; j ++ ) { if ( j < 0 || j >= width ) { continue ; } if ( S [ i ] [ j ] . equals ( " # " ) ) { count ++ ; } } } return count ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (block (continue_statement))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (block (continue_statement))) (if_statement condition: (parenthesized_expression (method_invocation object: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) consequence: (block (expression_statement (update_expression (identifier))))))))) (return_statement (identifier))))