public static boolean samechars ( String [ ] st ) {
  int [ ] ar = new int [ 26 ] ;
  for ( int i = 0 ;
  i < st [ 0 ] . length ( ) ;
  i ++ ) ar [ st [ 0 ] . charAt ( i ) - 'a' ] ++ ;
  for ( int j = 1 ;
  j < st . length ;
  j ++ ) {
    int [ ] tar = new int [ 26 ] ;
    for ( int i = 0 ;
    i < st [ j ] . length ( ) ;
    i ++ ) tar [ st [ j ] . charAt ( i ) - 'a' ] ++ ;
    if ( ! Arrays . equals ( ar , tar ) ) return false ;
  }
  return true ;
}

public static boolean samechars ( String [ ] st ) { int [ ] ar = new int [ 26 ] ; for ( int i = 0 ; i < st [ 0 ] . length ( ) ; i ++ ) ar [ st [ 0 ] . charAt ( i ) - ' a ' ] ++ ; for ( int j = 1 ; j < st . length ; j ++ ) { int [ ] tar = new int [ 26 ] ; for ( int i = 0 ; i < st [ j ] . length ( ) ; i ++ ) tar [ st [ j ] . charAt ( i ) - ' a ' ] ++ ; if ( ! Arrays . equals ( ar , tar ) ) return false ; } return true ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (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: (method_invocation object: (array_access array: (identifier) index: (decimal_integer_literal)) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (expression_statement (update_expression (array_access array: (identifier) index: (binary_expression left: (method_invocation object: (array_access array: (identifier) index: (decimal_integer_literal)) name: (identifier) arguments: (argument_list (identifier))) right: (character_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: (field_access object: (identifier) field: (identifier))) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (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: (method_invocation object: (array_access array: (identifier) index: (identifier)) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (expression_statement (update_expression (array_access array: (identifier) index: (binary_expression left: (method_invocation object: (array_access array: (identifier) index: (identifier)) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal)))))) (if_statement condition: (parenthesized_expression (unary_expression operand: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))))) consequence: (return_statement (false))))) (return_statement (true))))