public static boolean isWin ( int n , int m , List < Integer > temp ) {
  if ( m < n ) return false ;
  if ( n == m ) {
    ans = new ArrayList < Integer > ( temp ) ;
    return true ;
  }
  boolean ans = false ;
  if ( m % 2 == 0 ) {
    temp . add ( m / 2 ) ;
    ans |= isWin ( n , m / 2 , temp ) ;
    temp . remove ( temp . size ( ) - 1 ) ;
  }
  else if ( m % 10 == 1 ) {
    temp . add ( ( m - 1 ) / 10 ) ;
    ans |= isWin ( n , ( m - 1 ) / 10 , temp ) ;
    temp . remove ( temp . size ( ) - 1 ) ;
  }
  return ans ;
}

public static boolean isWin ( int n , int m , List < Integer > temp ) { if ( m < n ) return false ; if ( n == m ) { ans = new ArrayList < Integer > ( temp ) ; return true ; } boolean ans = false ; if ( m % 2 == 0 ) { temp . add ( m / 2 ) ; ans |= isWin ( n , m / 2 , temp ) ; temp . remove ( temp . size ( ) - 1 ) ; } else if ( m % 10 == 1 ) { temp . add ( ( m - 1 ) / 10 ) ; ans |= isWin ( n , ( m - 1 ) / 10 , temp ) ; temp . remove ( temp . size ( ) - 1 ) ; } return ans ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (generic_type (type_identifier) (type_arguments (type_identifier))) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (return_statement (false))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (object_creation_expression type: (generic_type (type_identifier) (type_arguments (type_identifier))) arguments: (argument_list (identifier))))) (return_statement (true)))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (false))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal)) (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)))))))) (return_statement (identifier))))