There is an error in the explanation, it should say:
Capacity = 2, Index =2, since item at index ‘2’ has weight ‘3’, which is greater than the capacity ‘2’, so we will take the dp[index-1][capacity]
Type your question above this line.
Course: https://www.educative.io/collection/5668639101419520/5671464854355968
Lesson: https://www.educative.io/collection/page/5668639101419520/5671464854355968/5008218180812800