public static void solver ( int N , boolean [ ] [ ] edges ) {
  Set < Integer > left_nodes = new HashSet < Integer > ( ) ;
  for ( int n = 0 ;
  n < N ;
  n ++ ) {
    left_nodes . add ( n ) ;
  }
  int ans = 0 ;
  int before_ans = ans + 1 ;
  while ( ans != before_ans ) {
    before_ans = ans ;
    HashMap < Integer , Integer > bridgeable_nodes = new HashMap < Integer , Integer > ( ) ;
    for ( Integer from : left_nodes ) {
      ArrayList < Integer > bridge_nodes = new ArrayList < Integer > ( ) ;
      for ( int to = 0 ;
      to < N ;
      to ++ ) {
        if ( edges [ from ] [ to ] == true ) {
          bridge_nodes . add ( to ) ;
        }
      }
      if ( bridge_nodes . size ( ) == 1 ) {
        bridgeable_nodes . put ( from , bridge_nodes . get ( 0 ) ) ;
      }
    }
    for ( Integer from : bridgeable_nodes . keySet ( ) ) {
      int to = bridgeable_nodes . get ( from ) ;
      left_nodes . remove ( from ) ;
      if ( edges [ from ] [ to ] == false ) {
        continue ;
      }
      edges [ from ] [ to ] = false ;
      edges [ to ] [ from ] = false ;
      ans ++ ;
    }
  }
  out . println ( ans ) ;
}

public static void solver ( int N , boolean [ ] [ ] edges ) { Set < Integer > left_nodes = new HashSet < Integer > ( ) ; for ( int n = 0 ; n < N ; n ++ ) { left_nodes . add ( n ) ; } int ans = 0 ; int before_ans = ans + 1 ; while ( ans != before_ans ) { before_ans = ans ; HashMap < Integer , Integer > bridgeable_nodes = new HashMap < Integer , Integer > ( ) ; for ( Integer from : left_nodes ) { ArrayList < Integer > bridge_nodes = new ArrayList < Integer > ( ) ; for ( int to = 0 ; to < N ; to ++ ) { if ( edges [ from ] [ to ] == true ) { bridge_nodes . add ( to ) ; } } if ( bridge_nodes . size ( ) == 1 ) { bridgeable_nodes . put ( from , bridge_nodes . get ( 0 ) ) ; } } for ( Integer from : bridgeable_nodes . keySet ( ) ) { int to = bridgeable_nodes . get ( from ) ; left_nodes . remove ( from ) ; if ( edges [ from ] [ to ] == false ) { continue ; } edges [ from ] [ to ] = false ; edges [ to ] [ from ] = false ; ans ++ ; } } out . println ( ans ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (array_type element: (boolean_type) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments (type_identifier))) arguments: (argument_list)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) body: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) arguments: (argument_list)))) (enhanced_for_statement type: (type_identifier) name: (identifier) value: (identifier) body: (block (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments (type_identifier))) arguments: (argument_list)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (true))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal)))))))))) (enhanced_for_statement type: (type_identifier) name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (false))) consequence: (block (continue_statement))) (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (false))) (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (false))) (expression_statement (update_expression (identifier))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))))