Problem Β· Array
Maximize Points π³ -- Not OA but an INTERVIEW Question! π· :)
See Google hiring insights
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! π‘β.Λ πΌ
Examples
01 Β· Example 1
points = [25, 1, 3, 99, 4] return = 100
Take 1 and 99, the solution is 100.
Constraints
π
More Google problems
- Periodic Table Word FormationsPHONE SCREEN Β· Seen Jun 2026
- Split and Sort ArraySeen Jun 2026
- Fountain SafetyONSITE INTERVIEW Β· Seen Jun 2026
- Consolidate On-Call RotationsOA Β· Seen Jun 2026
- Detonate Bombs with Chain ReactionsONSITE INTERVIEW Β· Seen May 2026
- Evaluate a Nested Math ExpressionONSITE INTERVIEW Β· Seen May 2026
- Tic-Tac-Toe Game StatusPHONE SCREEN Β· Seen May 2026
- Longest Dictionary TokenizationPHONE SCREEN Β· Seen May 2026
public int maximizePoints(int[] points) {
// write your code here
}
points[25, 1, 3, 99, 4]
expected100
checking account