Skip to content

Practice Profitable Schemes

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Hard#879
LeetCode Problem

Profitable Schemes

Problem Statement

There are n available members and a list of jobs. Job i requires group[i] members and earns profit[i]; a member can participate in at most one selected job. Count the subsets of jobs whose total required members is at most n and whose total profit is at least minProfit. Return the count modulo 10^9 + 7.

Source: Profitable Schemes on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
n = 5, minProfit = 3, group = [2,2], profit = [2,3]
Output
2

# Example 2

Input
n = 10, minProfit = 5, group = [2,3,5], profit = [6,7,8]
Output
7

Constraints

1 <= n <= 100
0 <= minProfit <= 100
1 <= group.length <= 100
1 <= group[i] <= 100
profit.length == group.length
0 <= profit[i] <= 100

Related LeetCode Problems

Practice more problems similar to Profitable Schemes.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.