dynamic programming lecture 10 3213520