title: Coin Game Winner Every Player Three Choices
signature: function coinGameWinnerEveryPlayerThreeChoices(x: number, y: number, n: number): boolean {
source_py: def coin_game_winner_every_player_three_choices(x, y, n):
      dp = [0 for i in range((n + 1))]
      dp[0] = False
      dp[1] = True
      for i in range(2, (n + 1)):
          if (((i - 1) >= 0) and (not dp[(i - 1)])):
              dp[i] = True
          elif (((i - x) >= 0) and (not dp[(i - x)])):
              dp[i] = True
          elif (((i - y) >= 0) and (not dp[(i - y)])):
              dp[i] = True
          else:
              dp[i] = False
      return dp[n]
source_cpp: bool coin_game_winner_every_player_three_choices(int x, int y, int n) {
    int dp [ n + 1 ];
    dp [ 0 ] = false;
    dp [ 1 ] = true;
    for ( int i = 2;
    i <= n;
    i ++ ) {
      if ( i - 1 >= 0 and ! dp [ i - 1 ] ) dp [ i ] = true;
      else if ( i - x >= 0 and ! dp [ i - x ] ) dp [ i ] = true;
      else if ( i - y >= 0 and ! dp [ i - y ] ) dp [ i ] = true;
      else dp [ i ] = false;
    }
    return dp [ n ];
  }
question_info.test_list: [{"idx": 0, "outputs": false, "inputs": {"x": 6, "y": 27, "n": 51}}, {"idx": 1, "outputs": true, "inputs": {"x": 32, "y": 88, "n": 69}}, {"idx": 2, "outputs": false, "inputs": {"x": 99, "y": 18, "n": 48}}, {"idx": 3, "outputs": true, "inputs": {"x": 22, "y": 1, "n": 74}}, {"idx": 4, "outputs": false, "inputs": {"x": 26, "y": 78, "n": 95}}, {"idx": 5, "outputs": true, "inputs": {"x": 67, "y": 51, "n": 27}}, {"idx": 6, "outputs": true, "inputs": {"x": 69, "y": 57, "n": 91}}, {"idx": 7, "outputs": false, "inputs": {"x": 39, "y": 8, "n": 9}}, {"idx": 8, "outputs": true, "inputs": {"x": 7, "y": 82, "n": 41}}, {"idx": 9, "outputs": true, "inputs": {"x": 91, "y": 56, "n": 7}}]
question_info.entry_cls_name: Solution
question_info.test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: boolean, expected: boolean): boolean {
      return convertToString(actual) === convertToString(expected);
  }
  
  function driver(x: number, y: number, n: number, expected:boolean): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(x, y, n),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(6, 27, 51, false);
    console.log(`TEST-0...${result}`);
  
    result = driver(32, 88, 69, true);
    console.log(`TEST-1...${result}`);
  
    result = driver(99, 18, 48, false);
    console.log(`TEST-2...${result}`);
  
    result = driver(22, 1, 74, true);
    console.log(`TEST-3...${result}`);
  
    result = driver(26, 78, 95, false);
    console.log(`TEST-4...${result}`);
  
    result = driver(67, 51, 27, true);
    console.log(`TEST-5...${result}`);
  
    result = driver(69, 57, 91, true);
    console.log(`TEST-6...${result}`);
  
    result = driver(39, 8, 9, false);
    console.log(`TEST-7...${result}`);
  
    result = driver(7, 82, 41, true);
    console.log(`TEST-8...${result}`);
  
    result = driver(91, 56, 7, true);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
question_info.extension: ts
question_info.entry_fn_name: coinGameWinnerEveryPlayerThreeChoices
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: tsc --target es2020 --lib es5,dom,es2015,es2020 __FILENAME__
question_info.commands: node __FILENAME__.js