Ad
  • Custom User Avatar

    It looks like this is a time series of price values of some item: you read the prices left to right, and for each price value you must decide to buy or sell or pass. You cannot go back in time. In your example, if you bought at 0.8, you would only be able to sell at 0.9 or 1.0, because selling at 1.2 would require you to go back in time.

  • Custom User Avatar

    Very artificial exercise. Completely useless test cases. Waste of time

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution