Hi there, I am not really asking for help in terms of a programming solution but rather if anyone is able to explain the logic of this question to me cause i really cannot make sense of this!!!!
Here it is:
Introduction
For reasons understood only by stock-brokers, one of the
signs of a good stock trading strategy is to always buy a
stock for less than one previously bought it for.
Task
You’ve been asked to help measure the performance of
some stock-brokers by looking at the history of prices for
a stock. You will be provided with a list of prices, and
must determine the maximum number of times this stock
could have been bought while paying strictly less for it
each time
Example
Suppose that a stock has had historical prices of R10,
R5, R30, R25, R23, R25, R20, R24 and R22. Then the
maximum number of times it could be bought would be
4, buying it for R30, R25, R24 and R22. Notice that the
price must strictly decrease each time, so it cannot be
bought twice for R25.
Example
R1, R5 can be bought only 1 time.
The actual programming of this looks pretty simple but the logic of what they are asking just doesn't make sense to me so please help explain it if you can!
Thanks a lot
Ava19
Here it is:
Introduction
For reasons understood only by stock-brokers, one of the
signs of a good stock trading strategy is to always buy a
stock for less than one previously bought it for.
Task
You’ve been asked to help measure the performance of
some stock-brokers by looking at the history of prices for
a stock. You will be provided with a list of prices, and
must determine the maximum number of times this stock
could have been bought while paying strictly less for it
each time
Example
Suppose that a stock has had historical prices of R10,
R5, R30, R25, R23, R25, R20, R24 and R22. Then the
maximum number of times it could be bought would be
4, buying it for R30, R25, R24 and R22. Notice that the
price must strictly decrease each time, so it cannot be
bought twice for R25.
Example
R1, R5 can be bought only 1 time.
The actual programming of this looks pretty simple but the logic of what they are asking just doesn't make sense to me so please help explain it if you can!
Thanks a lot
Ava19
Comment