human
What is a code to maximum games played by winner and the other steps required given the following:
Maximum games played by winner | method returns maximum games a winner needs to play in N - player tournament.
for 0 games , 1 player is needed for 1 game , 2 players are required.
loop until i - th Fibonacci number is less than or equal to N.
result is ( i - 1 ) because i will be incremented one extra in while loop and we want the last value which is smaller than N , so.
Driver code"
Solution in Python:
assistant
#Here is code to maximum games played by winner and the other steps required.
 def maxGameByWinner ( 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 )
N = 10
print ( maxGameByWinner ( N ) )