static int largestSideLen ( int matrix [ ] [ ] ) {
  int result = 1 ;
  for ( int i = 0 ;
  i < ( n / 2 ) ;
  i ++ ) {
    int element = matrix [ i ] [ i ] ;
    int isSquare = 1 ;
    for ( int j = i ;
    j < n - i ;
    j ++ ) {
      if ( matrix [ i ] [ j ] != element ) isSquare = 0 ;
      if ( matrix [ n - i - 1 ] [ j ] != element ) isSquare = 0 ;
      if ( matrix [ j ] [ i ] != element ) isSquare = 0 ;
      if ( matrix [ j ] [ n - i - 1 ] != element ) isSquare = 0 ;
    }
    if ( isSquare > 0 ) return n - ( 2 * i ) ;
  }
  return result ;
}

static int largestSideLen ( int matrix [ ] [ ] ) { int result = 1 ; for ( int i = 0 ; i < ( n / 2 ) ; i ++ ) { int element = matrix [ i ] [ i ] ; int isSquare = 1 ; for ( int j = i ; j < n - i ; j ++ ) { if ( matrix [ i ] [ j ] != element ) isSquare = 0 ; if ( matrix [ n - i - 1 ] [ j ] != element ) isSquare = 0 ; if ( matrix [ j ] [ i ] != element ) isSquare = 0 ; if ( matrix [ j ] [ n - i - 1 ] != element ) isSquare = 0 ; } if ( isSquare > 0 ) return n - ( 2 * i ) ; } return result ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions))) 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: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))) 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))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (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: (identifier))) consequence: (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (array_access array: (identifier) index: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) index: (identifier)) right: (identifier))) consequence: (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (identifier))) consequence: (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) right: (identifier))) consequence: (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (return_statement (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (identifier)))))))) (return_statement (identifier))))