Dynamic programming (DP) is one of the most powerful techniques in computer science for solving optimization problems. It breaks down complex problems into simpler subproblems