title: Coin Game Winner Every Player Three Choices
signature: pub fn coin_game_winner_every_player_three_choices(x: i32, y: i32, n: i32) -> bool {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: bool, expected: bool)->bool{
  return actual==expected
  }
  pub fn driver(x: i32, y: i32, n: i32, expected: bool)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(x, y, n), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        6, 27, 51, 
        false
      ));
      
      println!("TEST-1...{}", driver(
        32, 88, 69, 
        true
      ));
      
      println!("TEST-2...{}", driver(
        99, 18, 48, 
        false
      ));
      
      println!("TEST-3...{}", driver(
        22, 1, 74, 
        true
      ));
      
      println!("TEST-4...{}", driver(
        26, 78, 95, 
        false
      ));
      
      println!("TEST-5...{}", driver(
        67, 51, 27, 
        true
      ));
      
      println!("TEST-6...{}", driver(
        69, 57, 91, 
        true
      ));
      
      println!("TEST-7...{}", driver(
        39, 8, 9, 
        false
      ));
      
      println!("TEST-8...{}", driver(
        7, 82, 41, 
        true
      ));
      
      println!("TEST-9...{}", driver(
        91, 56, 7, 
        true
      ));
      
  }
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 ];
  }