Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 48s1 days 16 hours 1 minutes 48 seconds.
Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 48s1 days 16 hours 1 minutes 48 seconds.

Sign in to watch this lesson
Advanced - Dynamic Programming · 4:55
When the best answer for a row is built from the best answers for its contiguous pieces, the state is a segment [i, j] and the table fills in order of increasing length. We solve a two-player take-from-either-end game by storing the mover's advantage on each segment, read the optimal moves off the triangle, and then turn to the split form of interval DP, merging blocks at the cheapest cut with prefix sums, and see when its cubic cost is too much.