Profitable Schemes
Solve this the way you would in the interview: out loud, on a timer, with an AI interviewer asking follow-ups while you code. You get a scored report at the end.
Practice this as a mock interviewFree to start, no account neededProblem
A gang has n members. Crime i needs exactly group[i] members and yields profit[i]. A member who takes part in one crime cannot take part in another.
A **scheme** is any subset of crimes (the empty subset included) that uses at most n members in total and yields a combined profit of at least minProfit. Return the number of schemes modulo 10^9 + 7.
Examples
Constraints
- 1 <= n <= 100
- 0 <= minProfit <= 100
- 1 <= group.length <= 100
- group.length == profit.length
- 1 <= group[i] <= 100
- 0 <= profit[i] <= 100
What the interviewer grades
A correct solution is one of five scores. The report also grades problem understanding (did you clarify inputs and edge cases before coding), problem solving, communication while you work, code quality, and testing. See a sample report, or read up on the pattern in the lessons.