# Leetcode 2140: Solving Questions With Brainpower

3 min readJan 19, 2022

In this problem, we are trying to find a testing strategy to optimize the number of points in a test giving the following rules:

You are given a

0-indexed2D integer array`questions`

where`questions[i] = [pointsi, brainpoweri]`

.The array describes the questions of an exam, where you have to process the questions

in order(i.e., starting from question`0`

) and make a decision whether tosolveorskipeach question. Solving question`i`

willearnyou`pointsi`

points but you will beunableto solve each of the next`brainpoweri`

…