static void right_left ( int a [ ] , int n ) {
  Map < Integer , Integer > total = new HashMap < > ( ) ;
  Map < Integer , Integer > left = new HashMap < > ( ) ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) total . put ( a [ i ] , total . get ( a [ i ] ) == null ? 1 : total . get ( a [ i ] ) + 1 ) ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    System . out . print ( ( total . get ( a [ i ] ) - 1 - ( 2 * ( left . containsKey ( a [ i ] ) == true ? left . get ( a [ i ] ) : 0 ) ) ) + " " ) ;
    left . put ( a [ i ] , left . get ( a [ i ] ) == null ? 1 : left . get ( a [ i ] ) + 1 ) ;
  }
}

static void right_left ( int a [ ] , int n ) { Map < Integer , Integer > total = new HashMap < > ( ) ; Map < Integer , Integer > left = new HashMap < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) total . put ( a [ i ] , total . get ( a [ i ] ) == null ? 1 : total . get ( a [ i ] ) + 1 ) ; for ( int i = 0 ; i < n ; i ++ ) { System . out . print ( ( total . get ( a [ i ] ) - 1 - ( 2 * ( left . containsKey ( a [ i ] ) == true ? left . get ( a [ i ] ) : 0 ) ) ) + " ▁ " ) ; left . put ( a [ i ] , left . get ( a [ i ] ) == null ? 1 : left . get ( a [ i ] ) + 1 ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (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)) arguments: (argument_list)))) (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)) 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: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)) (ternary_expression condition: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)))) right: (null_literal)) consequence: (decimal_integer_literal) alternative: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)))) right: (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 (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)))) right: (decimal_integer_literal)) right: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (parenthesized_expression (ternary_expression condition: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)))) right: (true)) consequence: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)))) alternative: (decimal_integer_literal))))))) right: (string_literal))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)) (ternary_expression condition: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)))) right: (null_literal)) consequence: (decimal_integer_literal) alternative: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)))) right: (decimal_integer_literal))))))))))