FunctionRacerProblemsRace

Percent Change

EasyNumPyPython

For each pair of neighboring days, return the percent change from the earlier price to the later one: (later - earlier) / earlier * 100. The result has one fewer item than prices. All prices are above 0.

Example 1

prices [100,110,99]
returns [10.0,-10.0]

100 to 110 is +10 percent; 110 to 99 is -10 percent.

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