prices holds an item's price day by day. Say the price moves one way if over the whole period it either never went down **or** never went up (staying flat is allowed).
Return True if the price moves one way, and False otherwise.prices=[3, 3, 5, 8, 8] → True
The price never went down, so it moves one way.
prices=[9, 4, 4, -2] → True
The price never went up.
prices=[1, 5, 2] → False
First a rise, then a drop: the trend changed direction.
prices=[3, 3, 5, 8, 8]
True
Run checks the first 3 tests in your browser. Submit checks all 154 tests on the server, hidden ones included.