title: Maximum Games Played Winner
signature: maximumGamesPlayedWinner(n) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(int actual, int expected){
      return actual.toString() == expected.toString();
  }
  
  String driver(n, int expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          73, 
          8)
      }");
  
      print("TEST-1...${driver(
          28, 
          6)
      }");
  
      print("TEST-2...${driver(
          33, 
          6)
      }");
  
      print("TEST-3...${driver(
          23, 
          6)
      }");
  
      print("TEST-4...${driver(
          84, 
          8)
      }");
  
      print("TEST-5...${driver(
          31, 
          6)
      }");
  
      print("TEST-6...${driver(
          48, 
          7)
      }");
  
      print("TEST-7...${driver(
          46, 
          7)
      }");
  
      print("TEST-8...${driver(
          45, 
          7)
      }");
  
      print("TEST-9...${driver(
          90, 
          9)
      }");
  
      return 0;
  }
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 );
  }