Daily Change
prices has columns day and price (whole numbers). Return a list with how much the price changed since the previous row (this row minus the one before). The first row has no previous row, so its change is 0.
Example 1
prices {"day":[1,2,3],"price":[10,13,11]}
returns [0,3,-2]
0, +3, -2.
Constraints
- The tables are small
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.