Best Time to Buy and Sell Stock III | Leetcode

Описание к видео Best Time to Buy and Sell Stock III | Leetcode

This video explains a very important programming interview problem which is buy and sell stock 3 which is from leetcode 123.I have already explained buy and sell stock 2 and buy and sell stock with cooldown and the LINK for these are present below.In this problem, i have explained the solution along with intuition for solving the problem.I have first shown the solution using backtracking and recursion and then i have shown the optimization using multi state memoization array.I have also shown an alternate memoization technique which is by using key as string (containing all appended states) and value as maximum profit obtained for that state.I have also shown all possible state transitions for all possible choices.The second method is by using divide and conquer technique which is intuitive if we divide the entire stock days into 2 parts and we take the maximum profit from each part and just add them to get max profit.I have shown intuition with examples for solving using divide and conquer.At the end of the video,I have explained the code walk through for both the techniques.CODE LINK is present below as usual. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)

========================================================================
Join this channel to get access to perks:
   / @techdose4u  

INSTAGRAM :   / surya.pratap.k  

SUPPORT OUR WORK:   / techdose  

LinkedIn:   / surya-pratap-kahar-47bb01168  

WEBSITE: https://techdose.co.in/

TELEGRAM Channel LINK: https://t.me/codewithTECHDOSE

TELEGRAM Group LINK: https://t.me/joinchat/SRVOIxWR4sRIVv5...
=======================================================================

CODE LINK: https://gist.github.com/SuryaPratapK/...
USEFUL VIDEOS:-
Best time to buy and sell stock 2:    • Best time to buy and sell stock 2 | V...  
Best time to buy and sell stock with cooldown:    • Best time to buy and sell stock with ...  

Комментарии

Информация по комментариям в разработке