* Facts: If the price at day `j` is the maximum one among all prices, we can keep buying from day 0 to day j and get the maximum profits for day 0 to j. The best strategy has to be selling on day j. Then we know day 0 - j does not need to be considred anymore and we move to j+1 and the previous fact holds again.
* Implementation: scan from right to left and keep updating `max` value (max is always the maximum price between current index and the right-most index). At a given index `j`, two possiblities can happen:
* 1. if prices[j] < max, add the difference into the profits
* 2. if prices[j] >= max, all items to the right of j can be discarded