dynamic programming exercises committed