Problem Β· Array
Maximize Points π³ -- Not OA but an INTERVIEW Question! π· :)
Learn this problemProblem statement
Given an array, each value at each index represents points. If you "take" the points at value v, you can't take the points in the next v indices.
Maximize the amount of points you can take.
πΌ β.Λ πEndless thanks to Rachel! π‘β.Λ πΌ
Function
maximizePoints(points: int[]) β intExamples
Example 1
points = [25, 1, 3, 99, 4]return = 100Take 1 and 99, the solution is 100.
Constraints
π