I need help in my dynamic code

You must select a tag to post in this category. Please find the tag relating to the section of the course you are on E.g. loops, learn-compatibility

When you ask a question, don’t forget to include a link to the exercise or project you’re dealing with!

If you want to have the best chances of getting a useful answer quickly, make sure you follow our guidelines about how to ask a good question. That way you’ll be helping everyone – helping people to answer your question and helhttps://www.codecademy.com/journeys/computer-science/paths/cscj-22-algorithms/tracks/cscj-22-dynamic-programming/modules/cscj-22-dynamic-programming/articles/the-knapsack-problem-pythonping others who are stuck to find the question and answer! :slight_smile: good day im having trouble figuring out how to implament the decrement for the dynamic code in the link attached my code is incomplete but it looks something like this " if index == 0 or weight == 0:
matrix[index][weight] = 0
elif weights[index - 1] <= weight_cap:
includ = values[index - 1] + dynamic_knapsack(weight_cap, weights, values)
exclude = dynamic_knapsack(weight_cap, weights, values)
matrix[rows-1][weight_cap] = max(includ,exclude)"