The Question
Coding
Profitable Schemes Optimization
Given a set of $k$ tasks, where each task $i$ requires $group[i]$ workers and yields $profit[i]$ profit, determine the number of distinct subsets of tasks that can be performed such that the total number of workers required does not exceed $n$ and the total profit generated is at least $minProfit$. Note that each worker can only be assigned to one task. Return the total number of valid subsets modulo $10^9 + 7$.
Python
DP
Knapsack
March 23, 2026