Belvedere Trading's strategy simulator evaluates candidate strategies with different capital requirements and modeled returns. Given a fixed capital budget, select a subset of strategies that maximizes total modeled return.
Each strategy can be selected at most once. Return the maximum total value achievable without exceeding the budget.
Implement maximize_value(weights, values, capacity):
weights is a list of integers where weights[i] is the capital required by strategy i.values is a list of integers where values[i] is the modeled return from strategy i.capacity is the maximum total capital available.The lists have equal length, and every strategy is optional.
def maximize_value(weights, values, capacity):