static int countStr ( int i , String s ) {
  if ( i < 0 ) {
    if ( check ( s ) ) return 1 ;
    return 0 ;
  }
  char [ ] myNameChars = s . toCharArray ( ) ;
  myNameChars [ i ] = '0' ;
  s = String . valueOf ( myNameChars ) ;
  int ans = countStr ( i - 1 , s ) ;
  char [ ] myChar = s . toCharArray ( ) ;
  myChar [ i ] = '1' ;
  s = String . valueOf ( myChar ) ;
  ans += countStr ( i - 1 , s ) ;
  char [ ] myChar1 = s . toCharArray ( ) ;
  myChar1 [ i ] = '0' ;
  s = String . valueOf ( myChar1 ) ;
  return ans ;
}

static int countStr ( int i , String s ) { if ( i < 0 ) { if ( check ( s ) ) return 1 ; return 0 ; } char [ ] myNameChars = s . toCharArray ( ) ; myNameChars [ i ] = '0' ; s = String . valueOf ( myNameChars ) ; int ans = countStr ( i - 1 , s ) ; char [ ] myChar = s . toCharArray ( ) ; myChar [ i ] = '1' ; s = String . valueOf ( myChar ) ; ans += countStr ( i - 1 , s ) ; char [ ] myChar1 = s . toCharArray ( ) ; myChar1 [ i ] = '0' ; s = String . valueOf ( myChar1 ) ; return ans ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (type_identifier) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (if_statement condition: (parenthesized_expression (method_invocation name: (identifier) arguments: (argument_list (identifier)))) consequence: (return_statement (decimal_integer_literal))) (return_statement (decimal_integer_literal)))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (character_literal))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier))))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (character_literal))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier))))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (character_literal))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (return_statement (identifier))))