25.3 Buy and sell stock k times - daily stock price structure

#1

[EPIJ v 1.6.1]

25.3 is described as a generalization of the problem on page 1. In the one on page 1, share prices are represented by day as lowest price, highest price, and opening price. Does this mean that stock prices provided as input for 25.3 have the same structure i.e. lowest, highest, opening?

Thanks!

0 Likes

#2

No, it will be just array of integers of price of that day. You can check the code signature to confirm that as well.

1 Like

#3

@tsunghsienlee Different question about the same problem: Is it OK to buy and sell on the same day? Or does selling have to be on a different day from buying? Thanks!

0 Likes