Which Algorithm Uses Dynamic Programming Python