input: def optimal_knapsack_value(items: List[Tuple[int, int]], capacity: int) -> int:
      """Given a list of items with their values and weights, and a capacity of a knapsack, 
      the task is to find the optimal solution to solve the knapsack problem using 
      dynamic programming. This function returns the maximum value that can be put 
      in the knapsack of the given capacity.
      
      Example:
      >>> optimal_knapsack_value([(60, 10), (100, 20), (120, 30)], 50)
      220
      """
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]