FunctionRacerProblemsRace

Cumulative Max

BeginnerNumPyPython

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

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More NumPy problems