The solution to lg(F) is to do 1, 2, 4, 8, ... until the first egg breaks into 2^(k+1) , and then do a binary search in the range of 2^K to 2^(k+1) .
Another alternative is to perform the same process until the first egg breaks at 2^(k+1) , and then start, with the exception of adding 2^K to each height: 2^k + 1, 2^k + 2, 2^k + 4, 2^k + 8, ... You can continue to repeat this process to reduce the size of the range in which you perform an exponential search.
Timothy shields
source share