Hard
,Array
,DP
There is a group of n
members, and a list of various crimes they could commit. The ith crime generates a profit[i]
and requires group[i]
members to participate in it. If a member participates in one crime, that member can't participate in another crime.
Let's call a profitable scheme any subset of these crimes that generates at least minProfit
profit, and the total number of members participating in that subset of crimes is at most n
.
Return the number of schemes that can be chosen. Since the answer may be very large, return it modulo 109 + 7.
Example 1:
Example 2:
Constraints:
n
<= 100minProfit
<= 100group.length
<= 100group[i]
<= 100profit.length
== group.length
profit[i]
<= 100