Dynamic Programming General Method Algorithm Example Simple Resignation