human
What is a code to eggs dropping puzzle and the other steps required given the following:
Eggs dropping puzzle | Set 2 | Function to return the minimum number of trials needed in the worst case with n eggs and k floors.
Fill all the entries in table using optimal substructure property.
Return the minimum number of moves.
Driver code"
How can the above be solved in Python?
assistant
#Here is code to eggs dropping puzzle and the other steps required.
 def eggDrop ( n , k ) :
	dp = [ [ 0 for i in range ( n + 1 ) ] for j in range ( k + 1 ) ]
	x = 0 ;
	while ( dp [ x ] [ n ] < k ) :
		x += 1 ;
		for i in range ( 1 , n + 1 ) :
			dp [ x ] [ i ] = dp [ x - 1 ] [ i - 1 ] + dp [ x - 1 ] [ i ] + 1 ;
	return x ;
if __name__ == ' _ _ main _ _ ' :
	n = 2 ; k = 36 ;
	print ( eggDrop ( n , k ) ) ;