I was struggling to figure out states and transitions for bounded knapsack problem which is the most general case of knapsack problem, so please if someone can share some insights and code for this, it will be very helpful for us.
For those who may not be familiar with this term bounded knapsack:-
The bounded knapsack problem is like the 0/1 knapsack problem, except in this we are also given a count for each item. In other words, each item has a count si associated with it and we can select an item si times(at max) (1 ≤ i ≤ N).