Ones and Zeroes
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
You are given an array of binary strings strs and two budgets m and n. Choose a subset of the strings (each string at most once) such that, across the chosen strings, the total number of '0' characters is at most m and the total number of '1' characters is at most n.
Return the size of the largest such subset.
Examples
Constraints
- 1 <= strs.length <= 600
- 1 <= strs[i].length <= 100
- `strs[i]` consists only of `'0'` and `'1'`
- 1 <= m, n <= 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.