input: Write a python function to solve the knapsack problem.
  assert knapsack([2, 3, 5, 1, 6], [3, 8, 7, 2, 8], 6) == 15
  assert knapsack([1, 2, 3], [10, 15, 40], 6) == 65
  assert knapsack([1, 2, 3, 8, 7, 4], [20, 5, 10, 40, 15, 25], 10) == 60
output: def knapsack(weights, values, capacity):
      n = len(weights)
      dp = [[0 for _ in range(capacity + 1)] for _ in range(n + 1)]
      
      for i in range(1, n + 1):
          for w in range(1, capacity + 1):
              if weights[i - 1] <= w:
                  dp[i][w] = max(dp[i - 1][w], dp[i - 1][w - weights[i - 1]] + values[i - 1])
              else:
                  dp[i][w] = dp[i - 1][w]
                  
      return dp[n][capacity]