Find Maximum Number of Subjects Passed (AS Intern, but it may apply to other interns)
Problem Overview
- Determine the maximum number of subjects a student can pass by allocating q extra answers across subjects.
- Input: answered[i] (already answered), needed[i] (required to pass), and integer q; Output: an integer count; Constraints: 1≤n≤1e5, values up to 1e9.
- Context: quiz-style certification exam prep app with limited review attempts.
- From Amazon interviews; a coding interview problem and common interview question.
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Input Variables
Execution Result:
