title: Maximum Games Played Winner
signature: pub fn maximum_games_played_winner(n: i32) -> i32 {
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: i32, expected: i32)->bool{
  return actual==expected
  }
  pub fn driver(n: i32, expected: i32)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        73, 
        8
      ));
      
      println!("TEST-1...{}", driver(
        28, 
        6
      ));
      
      println!("TEST-2...{}", driver(
        33, 
        6
      ));
      
      println!("TEST-3...{}", driver(
        23, 
        6
      ));
      
      println!("TEST-4...{}", driver(
        84, 
        8
      ));
      
      println!("TEST-5...{}", driver(
        31, 
        6
      ));
      
      println!("TEST-6...{}", driver(
        48, 
        7
      ));
      
      println!("TEST-7...{}", driver(
        46, 
        7
      ));
      
      println!("TEST-8...{}", driver(
        45, 
        7
      ));
      
      println!("TEST-9...{}", driver(
        90, 
        9
      ));
      
  }
source_py: def maximum_games_played_winner(N):
      dp = [0 for i in range(N)]
      dp[0] = 1
      dp[1] = 2
      i = 1
      while (dp[i] <= N):
          i = (i + 1)
          dp[i] = (dp[(i - 1)] + dp[(i - 2)])
      return (i - 1)
source_cpp: int maximum_games_played_winner(int N) {
    int dp [ N ];
    dp [ 0 ] = 1;
    dp [ 1 ] = 2;
    int i = 2;
    do {
      dp [ i ] = dp [ i - 1 ] + dp [ i - 2 ];
    }
    while ( dp [ i ++ ] <= N );
    return ( i - 2 );
  }