title: Maximum Games Played Winner
signature: fun maximumGamesPlayedWinner(n: Int): Int {
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 );
  }
question_info.test_list: [{"idx": 0, "outputs": 8, "inputs": {"n": 73}}, {"idx": 1, "outputs": 6, "inputs": {"n": 28}}, {"idx": 2, "outputs": 6, "inputs": {"n": 33}}, {"idx": 3, "outputs": 6, "inputs": {"n": 23}}, {"idx": 4, "outputs": 8, "inputs": {"n": 84}}, {"idx": 5, "outputs": 6, "inputs": {"n": 31}}, {"idx": 6, "outputs": 7, "inputs": {"n": 48}}, {"idx": 7, "outputs": 7, "inputs": {"n": 46}}, {"idx": 8, "outputs": 7, "inputs": {"n": 45}}, {"idx": 9, "outputs": 9, "inputs": {"n": 90}}]
question_info.extension: kts
question_info.test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Int, expected:Int):Boolean{
    return actual.equals(expected)
  }
  fun driver(n: Int, expected:Int):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(73, 8)
      println("TEST-0...${result}")
      
      result = driver(28, 6)
      println("TEST-1...${result}")
      
      result = driver(33, 6)
      println("TEST-2...${result}")
      
      result = driver(23, 6)
      println("TEST-3...${result}")
      
      result = driver(84, 8)
      println("TEST-4...${result}")
      
      result = driver(31, 6)
      println("TEST-5...${result}")
      
      result = driver(48, 7)
      println("TEST-6...${result}")
      
      result = driver(46, 7)
      println("TEST-7...${result}")
      
      result = driver(45, 7)
      println("TEST-8...${result}")
      
      result = driver(90, 9)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: maximumGamesPlayedWinner
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn