public static boolean isAnagram ( String s , String t ) {
  int arr [ ] = new int [ 26 ] ;
  for ( char c : s . toCharArray ( ) ) {
    int x = ( int ) c - 97 ;
    arr [ x ] ++ ;
  }
  for ( char c : t . toCharArray ( ) ) {
    int x = ( int ) c - 97 ;
    arr [ x ] -- ;
  }
  boolean check = true ;
  for ( int i = 0 ;
  i < 26 ;
  i ++ ) {
    if ( arr [ i ] != 0 ) {
      check = false ;
      break ;
    }
  }
  return check ;
}

public static boolean isAnagram ( String s , String t ) { int arr [ ] = new int [ 26 ] ; for ( char c : s . toCharArray ( ) ) { int x = ( int ) c - 97 ; arr [ x ] ++ ; } for ( char c : t . toCharArray ( ) ) { int x = ( int ) c - 97 ; arr [ x ] -- ; } boolean check = true ; for ( int i = 0 ; i < 26 ; i ++ ) { if ( arr [ i ] != 0 ) { check = false ; break ; } } return check ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (type_identifier) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (decimal_integer_literal))))) (enhanced_for_statement type: (integral_type) 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: (binary_expression left: (cast_expression type: (integral_type) value: (identifier)) right: (decimal_integer_literal)))) (expression_statement (update_expression (array_access array: (identifier) index: (identifier)))))) (enhanced_for_statement type: (integral_type) 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: (binary_expression left: (cast_expression type: (integral_type) value: (identifier)) right: (decimal_integer_literal)))) (expression_statement (update_expression (array_access array: (identifier) index: (identifier)))))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (true))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (false))) (break_statement))))) (return_statement (identifier))))