Why it matters
Egg drop is interview classic. Understanding shapes tricky DPs.
Advertisement
The architecture
dp[k][n] = min trials worst case.
Drop from floor x: break or not.
Advertisement
How it works end to end
dp[k][n] = 1 + min over x of max(dp[k-1][x-1], dp[k][n-x]).
Inversion trick: dp[k][t] = max floors for k eggs + t trials.
Binary search x with quadrangle.