input: Write a python function to solve the knapsack problem.
  assert knapsack([2, 3, 4, 5], [3, 4, 5, 6], 5) == 7
  assert knapsack([1, 2, 3], [6, 10, 12], 5) == 22
  assert knapsack([10, 20, 30], [60, 100, 120], 50) == 220
output: def knapsack(weights, values, capacity):
      n = len(weights)
      dp = [[0 for x in range(capacity + 1)] for x in range(n + 1)]
      
      for i in range(n + 1):
          for w in range(capacity + 1):
              if i == 0 or w == 0:
                  dp[i][w] = 0
              elif weights[i-1] <= w:
                  dp[i][w] = max(values[i-1] + dp[i-1][w-weights[i-1]], dp[i-1][w])
              else:
                  dp[i][w] = dp[i-1][w]
                  
      return dp[n][capacity]