Best time to buy and sell stock 2 | Valley peak approach | Leetcode #122
58.5 هزار بار بازدید -
4 سال پیش
-
This video explains a very
This video explains a very important problem from april 30 days coding challenge on leetcode which is also important for software company interviews. I have explained the best time to buy and sell stock by using recursion, memoization and the most optimal valley peak approach. The optimal time is just O(N) for this problem in just O(1) extra space. As usual, CODE LINK is given below. 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 :)
CODE LINK: https://gist.github.com/SuryaPratapK/...
CODE LINK: https://gist.github.com/SuryaPratapK/...
4 سال پیش
در تاریخ 1399/01/17 منتشر شده
است.
58,595
بـار بازدید شده