Count Increases
Return the number of days on which the price was strictly higher than the day before. The first day has no day before it, so it never counts.
Example 1
prices [5,7,7,6,9]
returns 2
The price rose from 5 to 7 and from 6 to 9.
Constraints
1 <= len(prices) <= 100
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More NumPy problems
- Count Sign ChangesEasy
- Drop Lowest AverageEasy
- Empty SeatsEasy
- Fill MissingEasy
- First Day Over LimitEasy
- Full ColumnsEasy
- Good ColumnsEasy
- Group MaximumsEasy