private static boolean solve ( int [ ] [ ] board ) {
  int N = board . length ;
  int M = board [ 0 ] . length ;
  for ( int i = 0 ;
  i < N ;
  i ++ ) {
    for ( int j = 0 ;
    j < M ;
    j ++ ) {
      int a = board [ i ] [ j ] ;
      int rmax = 0 , cmax = 0 ;
      for ( int x = 0 ;
      x < M ;
      x ++ ) {
        if ( x != j ) {
          rmax = Math . max ( rmax , board [ i ] [ x ] ) ;
        }
      }
      for ( int y = 0 ;
      y < N ;
      y ++ ) {
        if ( y != i ) {
          cmax = Math . max ( cmax , board [ y ] [ j ] ) ;
        }
      }
      if ( rmax > a && cmax > a ) {
        return false ;
      }
    }
  }
  return true ;
}

private static boolean solve ( int [ ] [ ] board ) { int N = board . length ; int M = board [ 0 ] . length ; for ( int i = 0 ; i < N ; i ++ ) { for ( int j = 0 ; j < M ; j ++ ) { int a = board [ i ] [ j ] ; int rmax = 0 , cmax = 0 ; for ( int x = 0 ; x < M ; x ++ ) { if ( x != j ) { rmax = Math . max ( rmax , board [ i ] [ x ] ) ; } } for ( int y = 0 ; y < N ; y ++ ) { if ( y != i ) { cmax = Math . max ( cmax , board [ y ] [ j ] ) ; } } if ( rmax > a && cmax > a ) { return false ; } } } return true ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (field_access object: (array_access array: (identifier) index: (decimal_integer_literal)) field: (identifier)))) (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 (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 (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (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: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)))))))))) (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: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (block (return_statement (false)))))))) (return_statement (true))))