@@ -0,0 +1,455 @@
+%22%22%22%0AGiven weights and values of n items, put these items in a knapsack of capacity W to get the maximum total value in the knapsack.%0A%22%22%22%0Adef knapsack(W, wt, val, n):%0A    dp = %5B%5B0 for i in range(W+1)%5Dfor j in range(n+1)%5D%0A%0A    for i in range(1,n+1):%0A        for w in range(1,W+1):%0A            if(wt%5Bi-1%5D%3C=w):%0A                dp%5Bi%5D%5Bw%5D = max(val%5Bi-1%5D+dp%5Bi-1%5D%5Bw-wt%5Bi-1%5D%5D,dp%5Bi-1%5D%5Bw%5D)%0A            else:%0A                dp%5Bi%5D%5Bw%5D = dp%5Bi-1%5D%5Bw%5D%0A%0A    return dp%5Bn%5D%5Bw%5D%0A

Create knapsack.py