Description
Given exam questions with points and brainpower (skip count after solving), maximize points by choosing which questions to solve.
Examples
Input:
questions = [[3,2],[4,3],[4,4],[2,5]]Output:
5Explanation:
Solve q0 + q3.
Input:
questions = [[1]]Output:
1Explanation:
Minimal case with a single question.
Input:
questions = [[5,1],[2,2],[3,1],[1,0]]Output:
8Explanation:
Take question 0 (5 points, skip 1), skip question 1, take question 2 (3 points, skip 1), skip question 3. Total: 5 + 3 = 8 points.
Constraints
- •
1 ≤ questions.length ≤ 10⁵