Algorithm problems that involves dynamic programming