Buy ans Sell Stock has many type of variations.

1. Buy and Sell Stock I -> Only 1 transaction is allowed. Code

2. Buy and Sell Stock II -> Infinite transactions are allowed. Code

3. Buy and Sell Stock III -> At most 2 transactions are allowed. Code

4. Buy and Sell Stock IV -> At most k transactions are allowed. Code

5. Buy and Sell Stock with Cooldown -> At most 1 transaction is allowed with a cooldown period of one day means you can't sell at index i and buy again at index i+1, but you can make as many transaction as possible. Code

6. Buy ans Sell Stock with transaction fee Code

7. Buy I stocks on ith day Code

8. Buy Maximum Stocks if i stocks can be bought on i-th day Code

9. Stock Span Problem Code

Last updated