[Leetcode]714. Best Time to Buy and Sell Stock with Transaction Fee

LeetCode_logo

This series of Buy and Sell Stock I~VI on Leetcode is a great practice for Dynamic Programming – State Machine. Therefore I prepared blogs for each of them and hopefully it would help you to understand them better. You can find the relations of them at the bottom and feel free to leave any comments. 

Continue reading “[Leetcode]714. Best Time to Buy and Sell Stock with Transaction Fee”

[Leetcode]309. Best Time to Buy and Sell Stock with Cooldown

LeetCode_logo

This series of Buy and Sell Stock I~VI on Leetcode is a great practice for Dynamic Programming – State Machine. Therefore I prepared blogs for each of them and hopefully it would help you to understand them better. You can find the relations of them at the bottom and feel free to leave any comments. 

Continue reading “[Leetcode]309. Best Time to Buy and Sell Stock with Cooldown”

[Leetcode]188. Best Time to Buy and Sell Stock IV

LeetCode_logo

This series of Buy and Sell Stock I~VI on Leetcode is a great practice for Dynamic Programming – State Machine. Therefore I prepared blogs for each of them and hopefully it would help you to understand them better. You can find the relations of them at the bottom and feel free to leave any comments. 

Continue reading “[Leetcode]188. Best Time to Buy and Sell Stock IV”

[Leetcode]123. Best Time to Buy and Sell Stock III

LeetCode_logo

This series of Buy and Sell Stock I~VI on Leetcode is a great practice for Dynamic Programming – State Machine. Therefore I prepared blogs for each of them and hopefully it would help you to understand them better. You can find the relations of them at the bottom and feel free to leave any comments. 

Continue reading “[Leetcode]123. Best Time to Buy and Sell Stock III”

[Leetcode]122. Best Time to Buy and Sell Stock II

LeetCode_logo

This series of Buy and Sell Stock I~VI on Leetcode is a great practice for Dynamic Programming – State Machine. Therefore I prepared blogs for each of them and hopefully it would help you to understand them better. You can find the relations of them at the bottom and feel free to leave any comments. 

Continue reading “[Leetcode]122. Best Time to Buy and Sell Stock II”

[Leetcode]121. Best Time to Buy and Sell Stock

LeetCode_logo

This series of Buy and Sell Stock I~VI on Leetcode is a great practice for Dynamic Programming – State Machine. Therefore I prepared blogs for each of them and hopefully it would help you to understand them better. You can find the relations of them at the bottom and feel free to leave any comments.

Continue reading “[Leetcode]121. Best Time to Buy and Sell Stock”

[Leetcode]1553. Minimum Number of Days to Eat N Oranges

LeetCode_logo
There are n oranges in the kitchen and you decided to eat some of these oranges every day as follows:
Eat one orange.
If the number of remaining oranges (n) is divisible by 2 then you can eat  n/2 oranges.
If the number of remaining oranges (n) is divisible by 3 then you can eat  2*(n/3) oranges.
You can only choose one of the actions per day.
Return the minimum number of days to eat n oranges.
Constraints:
1 <= n <= 2*10^9
Continue reading “[Leetcode]1553. Minimum Number of Days to Eat N Oranges”