input: def find_optimal_knapsack(items: List[Tuple[int, int]], capacity: int) -> int:
      """Find the optimal solution to the knapsack problem using dynamic programming.
      Given a list of items, each with a value and weight, and a capacity of the knapsack,
      the function returns the maximum value that can be obtained without exceeding the
      capacity of the knapsack.
  
      >>> find_optimal_knapsack([(60, 10), (100, 20), (120, 30)], 50)
      220
      >>> find_optimal_knapsack([(50, 3), (40, 2), (90, 4)], 5)
      90
      """
output:     dp = [0] * (capacity + 1)
      for value, weight in items:
          for w in range(capacity, weight - 1, -1):
              dp[w] = max(dp[w], dp[w - weight] + value)
      return dp[capacity]