Cumulative Max
Return an array where item i is the largest value among scores[0] through scores[i]. Hint: np.maximum.accumulate.
Example 1
scores [3,1,4,1,5]
returns [3,3,4,4,5]
The best so far is 3, 3, 4, 4, 5.
Constraints
1 <= len(scores) <= 100
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More NumPy problems
- Day to Day ChangeBeginner
- Diagonal From ValuesBeginner
- Evenly SpacedBeginner
- Every Other SumBeginner
- Hottest DayBeginner
- Lower Triangle TotalBeginner
- Median ScoreBeginner
- Multiples Up ToBeginner