Add solution for BestTimeToBuyAndSellStock version 1. There are 3 parts to this question so I'll add each one as a separate answer/test suite.
BestTimeToBuyAndSellStock2 from LeetCode.
BestTimeToBuyAndSellStock3 problem. For this guy, this is the first time where we can use a dynamic programming approach of building useful datasets incrementally about the stock purchases by day, that we can then combine later. While this solution works for 2 things, there must also be a more complicated general solution for doing k transactions. If I get a chance I'll try to back solve that solution as well.