Egg Dropping Puzzle with 2 Eggs and K Floors | PHP program to find optimal number of trials for k floors and 2 eggs . ; Driver Code
< ? php function twoEggDrop ( $ k ) { return ceil ( ( -1.0 + sqrt ( 1 + 8 * $ k ) ) / 2.0 ) ; } $ k = 100 ; echo twoEggDrop ( $ k ) ;