# Solving Questions With Brainpower (LeetCode 2140) DP: skip or take with brainpower skip. ## Approach ```python def mostPoints(questions): n = len(questions) dp = [0]*(n+1) for i in range(n-1, -1, -1): pts, skip = questions[i] j = i + skip + 1 take = pts + (dp[j] if j < n else 0) dp[i] = max(take, dp[i+1]) return dp[0] ``` ## Complexity - Time / space depend on the scan above; keep the solution linear when possible. ## Interview tip Narrate the invariant before coding. I drill these patterns with [undetectable AI interview copilot](https://www.linkjob.ai/interview-copilot/) ahead of OA rounds. *Disclosure: I work on Linkjob AI, an interview copilot. The algorithm above stands on its own.*