Tap here to switch tabs
Problem
Submissions

Problem: Solving Questions With Brainpower

Try to solve the Solving Questions With Brainpower problem.

Statement

You are given a 00 indexed 22D integer array questions where questions[i] == [‘extpointsi‘,‘extbrainpoweri‘][` ext{points}_i`, ` ext{brainpower}_i`].

The array represents an exam where you must process the questions in order from index 00 to index questions.length −1- 1. For each question i, you have two choices:

  • Solve question i: You earn points_i points, but you will be unable to solve the next brainpower_i questions. Consequently, the next question you can process is index i ++ brainpower_i +1+ 1.

  • Skip question i: You earn 00 points and move directly to process question i +1+ 1.

Return the maximum total points you can earn on the exam.

Constraints:

  • 1≤1 \leq questions.length ≤105\leq 10^5

  • questions[i].length =2= 2

  • 1≤1 \leq points_i, brainpower_i ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Solving Questions With Brainpower

Try to solve the Solving Questions With Brainpower problem.

Statement

You are given a 00 indexed 22D integer array questions where questions[i] == [‘extpointsi‘,‘extbrainpoweri‘][` ext{points}_i`, ` ext{brainpower}_i`].

The array represents an exam where you must process the questions in order from index 00 to index questions.length −1- 1. For each question i, you have two choices:

  • Solve question i: You earn points_i points, but you will be unable to solve the next brainpower_i questions. Consequently, the next question you can process is index i ++ brainpower_i +1+ 1.

  • Skip question i: You earn 00 points and move directly to process question i +1+ 1.

Return the maximum total points you can earn on the exam.

Constraints:

  • 1≤1 \leq questions.length ≤105\leq 10^5

  • questions[i].length =2= 2

  • 1≤1 \leq points_i, brainpower_i ≤105\leq 10^5