input: Write a function to solve a knapsack problem using dynamic programming. The function should take in the capacity of the knapsack, a list of item values, and a list of item weights, and return the maximum value that can be obtained.
  def knapSack(W, wt, val, n):
  assert knapSack(50, [10, 20, 30], [60, 100, 120], 3)==220
  assert knapSack(3, [2, 1, 2], [1, 1, 1], 3)==2
  assert knapSack(0, [10, 20, 30], [60, 100, 120], 3)==0
  assert knapSack(50, [], [], 0)==0
  assert knapSack(3, [2, 1, 2], [1, 1, 1], 2)==1
output: def knapSack(W, wt, val, n):
      dp = [0] * (W + 1)
      for i in range(n):
          for w in range(W, wt[i] - 1, -1):
              dp[w] = max(dp[w], dp[w - wt[i]] + val[i])
      return dp[W]