Count nonnegative buy/sell sequences | Optiver Interview Question