DP 36. Buy and Sell Stock - II | Recursion to Space Optimisation

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 มี.ค. 2022
  • Lecture Notes/C++/Java Codes: takeuforward.org/dynamic-prog...
    Problem Link: bit.ly/3nYO17H
    Please watch the video at 1.25x for a better experience.
    Pre-req for this Series: • Re 1. Introduction to ...
    a
    Make sure to join our telegram group for discussions: linktr.ee/takeUforward
    Full Playlist: • Striver's Dynamic Prog...
    In this video, we solve the Buy and Sell Stock II.
    If you have not yet checked our SDE sheet, you should definitely do it: takeuforward.org/interviews/s...
    You can also get in touch with me at my social handles: linktr.ee/takeUforward

ความคิดเห็น • 513

  • @nayansinghal5157
    @nayansinghal5157 ปีที่แล้ว +96

    Shall we Bow Down, yeah he is a KING.

  • @srihari5605
    @srihari5605 ปีที่แล้ว +129

    Guys, along with this dp approach, greedy also works in this problem.
    If you are curious:
    If the stock price of tomorrow is greater than today, buy it today and sell it tomorrow. (it is as greedy as it can be.)
    sum of all the profit is automatically the maximum profit anyone can get.
    sum = 0
    for i in range(1, len(prices)):
    sum += (prices[i] - prices[i-1]) if prices[i] >= prices[i-1] else 0
    return sum

    • @Dontpushyour_luck
      @Dontpushyour_luck ปีที่แล้ว +12

      thank you for explaining how greedy works here. greedy is indeed tougher than dp as it is tougher to get through observation that greedy will work.

    • @priyansh8656
      @priyansh8656 ปีที่แล้ว +7

      @@Dontpushyour_luck for recognizing the greedy can be used or not what I try to do is plot on a paper the numbers in the array or similar things and then if on sudden increase or decrease something happen then it gives a possibility of greedy>
      So far this approach has worked for me as here also while increasing do nothing the moment it decreases you need to sell it

    • @DipsNohawar
      @DipsNohawar ปีที่แล้ว

      @@priyansh8656 can you elaborate this intuition more ?

    • @siddharthchauhan961
      @siddharthchauhan961 ปีที่แล้ว +2

      Don't understand how greedy will be correct here.. If let's say there's an array [5,3,8], then buying stock on the first index(price=5) itself is a worse decision than buying stock on 2nd index(price=3) since in both cases the selling price will be 8 but the buying price is different?

    • @piyush2776
      @piyush2776 ปีที่แล้ว +3

      @@siddharthchauhan961 Greedy is applied on consecutive days. So only when successive day is larger than previous day we mark it as profit. In you example we will compare 5,3 since 3 is smaller we'll skip this iteration then we'll compare 3,8 since 8 is larger we'll count different as profit.
      Hope this helps.

  • @amitkulkarni9682
    @amitkulkarni9682 2 หลายเดือนก่อน +13

    In my entire life, I'll always remember this special guy. Always.

    • @Mohit_Q
      @Mohit_Q 11 วันที่ผ่านมา

      bro you are from which batch ?

  • @ShreyaSharma-rk4yx
    @ShreyaSharma-rk4yx 9 หลายเดือนก่อน +16

    i dont know how long my journey will go but for sure you are the best teacher ever❤❤

  • @soumyajitganguly2593
    @soumyajitganguly2593 2 ปีที่แล้ว +66

    Good effort to link the (more general) recursive approach to DP to 4 variable approach. But this problem can be solved from intuition in a very simple way using just 1 extra variable. Just compare today with yesterday and sell to make immediate profit (if today > yesterday). Keep doing so: profit += today - yesterday

    • @vimalslab3398
      @vimalslab3398 2 ปีที่แล้ว +7

      yes ... I solved this Q previously in this way. At that time I had no idea of dp.

    • @tusharnain6652
      @tusharnain6652 2 ปีที่แล้ว +2

      @@vimalslab3398 same bro!

    • @adityaajay29
      @adityaajay29 2 ปีที่แล้ว +3

      yeah, greedy works great here

    • @amandixit3555
      @amandixit3555 2 ปีที่แล้ว +5

      this is not intution , intution should have proof.

    • @Gurrari
      @Gurrari 2 ปีที่แล้ว +8

      @@amandixit3555 Good point, at first, i also solved it without using recursion, but now i see, that isn't very logical and intuitive, its just a flick that greedy worked here.

  • @girishthatte
    @girishthatte 10 หลายเดือนก่อน +4

    Thankyou so much Striver for your awesome DP Playlist. I was able to solve all the 6 variants of DP on stocks starting from recursion to space optimization very easily in one shot and in less time as well. This playlist is top-notch and I have got good confidence now in DP. Keep up the good work. No one can teach at your level. You are the best ❤❤

  • @stith_pragya
    @stith_pragya 6 หลายเดือนก่อน +2

    UNDERSTOOD.....Thank You So Much for this wonderful video......🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻

  • @RohitKumar-dy2gc
    @RohitKumar-dy2gc 8 หลายเดือนก่อน +1

    what an amazing approach the final one😊

  • @dhairyarajbabbar7584
    @dhairyarajbabbar7584 2 ปีที่แล้ว +6

    my approach of this question
    int maxProfit(vector& a) {
    int curr=a[0];
    int profit=0;
    for(int i=1;i

    • @WYNTL6980
      @WYNTL6980 วันที่ผ่านมา

      Great approach !!! TC = O(n) and SC= O(1).
      I request Mr Striver to highlight this comment for everyone to see.

  • @prathameshlohar3585
    @prathameshlohar3585 4 หลายเดือนก่อน +1

    Thanks Striver, I just watched this video and did other variations on my own.

  • @055muditsingh7
    @055muditsingh7 2 ปีที่แล้ว +5

    I am stuck with this problem for a few days, but after watching your video, I am able to solve the problem.
    Thanks Bhaiya .

  • @dxvya23
    @dxvya23 2 หลายเดือนก่อน

    Brilliant teaching skills ..hats off

  • @ManojKumar-wi2dn
    @ManojKumar-wi2dn 2 ปีที่แล้ว +18

    I WAS DOING THESE QUES FOR 2 WEEKS AND BY JUST SEEING THIS SINGLE VIDEO, I CAN DO ALL QUES ON STOCKS...THANKS A LOT

  • @sahilrepuriya3205
    @sahilrepuriya3205 3 หลายเดือนก่อน

    This is mind blowing🤯 .Understood sir thanks alot💙

  • @Dontpushyour_luck
    @Dontpushyour_luck ปีที่แล้ว +7

    Without watching your video, I solved this question on my own. Finally I am beginning to see through dp. I know I am yet a beginner in dp, but I shall learn dp so good that I would be able to do dp hard questions on codeforces. I know that it will be a long journey, but thank you for building my foundation so good. Dp is not intuitive at all but atleast for a beginning I am able to look into the intuition of dp.

    • @joshuamanivinod9873
      @joshuamanivinod9873 9 หลายเดือนก่อน

      How is your progress? :)

    • @Dontpushyour_luck
      @Dontpushyour_luck 9 หลายเดือนก่อน

      @@joshuamanivinod9873 pretty good. I have completed this playlist and now I am able to do dp without any fear. I am also able to understand solutions that others give for dp questions, whereas before I couldn't understand a bit of it.

  • @itsaryanb9316
    @itsaryanb9316 ปีที่แล้ว +4

    Damn Striver, your lectures are helping me alot in solving such problems without the need of watching the entire video !! Watched this video till recursion part, and did solved this Question from memoization to space optimisation on my own😀😇 Thanks Alott

  • @himanshuagrawal8012
    @himanshuagrawal8012 2 ปีที่แล้ว +20

    I am glad you explained the four variable solution, it was nightmare to understand that solution from discuss section.
    I solve by myself till 2 array optimization.
    UNDERSTOODDDDDDDD

  • @tanyaahuja7424
    @tanyaahuja7424 ปีที่แล้ว +2

    You are commendable, the efforts you put in making these videos, helps us to understand clearly. You teach the concept, through which we can solve any problem!! Keep up the hard work, and thank you !! 🙏🙏🌸🌸

  • @preetisahani5054
    @preetisahani5054 9 หลายเดือนก่อน

    Understood, Indeed it was amazing

  • @snehalshaevya5598
    @snehalshaevya5598 ปีที่แล้ว

    Striver, you don't even need the currBuy and currNotBuy variables. A great explanation, thanks for this DP series its really amazing.

  • @dipaligangawane980
    @dipaligangawane980 ปีที่แล้ว +9

    The way you explain is wonderful. Thank you so much Striver. I get addicted to this series.

    • @AshishKumar-ww1mr
      @AshishKumar-ww1mr ปีที่แล้ว +1

      same bro . its like some kinda webseries that provides good dopomine

  • @sanasainath7758
    @sanasainath7758 3 หลายเดือนก่อน

    excellent logical way

  • @ritikshandilya7075
    @ritikshandilya7075 12 วันที่ผ่านมา

    Thanks for amazing solution striver

  • @tanujarora4906
    @tanujarora4906 ปีที่แล้ว +5

    I got this in an Interview for a small Startup, could not solve it. As My whole DP Chapter was Pending. Thanks Striver ❤

  • @Porsche911Dream
    @Porsche911Dream ปีที่แล้ว +7

    Excellent explanation!!! Btw this can be solved without dp as well in O(n). Intuituion is similar, if we don't have stock we can only buy. If we have it we will update buy price if current value is lower than our buy price else we can sell it. While selling we'll keep going as long as we're getting higher value.
    long getMaximumProfit(long *values, int n)
    {
    bool hasStock=false;
    long buy=0,profit=0;
    for(int i=0;i

    • @pulkitjain5159
      @pulkitjain5159 ปีที่แล้ว

      ya , i thought for the greedy approach to just buy on the local minimas and sell it on local maximas

  • @shankhadeepbanerjee252
    @shankhadeepbanerjee252 4 หลายเดือนก่อน

    amazing explanation!

  • @bhargav1811
    @bhargav1811 ปีที่แล้ว +3

    How on earth can anyone get this type of intution to solve this type of problem?? Each problem with its own unique style !! DP just blows my mind !! Hope that I might can solve this type of problem one day by my own !!

  • @bokuto3641
    @bokuto3641 2 ปีที่แล้ว +32

    You don't know how much we all waited for this ❤️...Keep up the good work bhaiya...Good luck and have all our blessings 🥳

  • @sahilbadkul7130
    @sahilbadkul7130 2 ปีที่แล้ว +2

    Good morning sir, Understood this problem very well.
    Best explanation ever.
    I solved this problem lot of times by seeing solution in discussion forms but never understood,
    But today I understood this very well, never forgot this again.
    Thank you so much.

  • @DevashishJose
    @DevashishJose 6 หลายเดือนก่อน

    Understood Thank you so much

  • @rohitchanda8461
    @rohitchanda8461 11 หลายเดือนก่อน

    What an explanation! Never imagined that this question could be converted to such easy algebraic technique!

  • @immortal6978
    @immortal6978 7 หลายเดือนก่อน

    Understoood , but afer watching it twice .
    finally Hell lot ot effort requires to make and consume the video fruitfully.
    😎😎😎😎😎😎

  • @gaurabdas1510
    @gaurabdas1510 2 ปีที่แล้ว

    Understood! Also greedy solution is the best for this problem (C++ solution) -
    TC - O(n) and SC - O(1)
    long getMaximumProfit(long* values, int n)
    {
    if(n

  • @akshatgoyal9113
    @akshatgoyal9113 2 ปีที่แล้ว

    Recurrence isnt required for this question either.
    You can simply buy the stock on every day and sell it either on the same day if the next day has a lesser value or sell it next day and buy it again if it has a greater value.
    Time Complexity-> O(N)
    Space Complexity->O(1)
    public class Solution {
    public static long getMaximumProfit (int n, long[] values) {
    if(n==0) return 0;
    long total=0;
    for(int i=1;i0)
    total+=values[i]-values[i-1];
    return total;
    }
    }

  • @sandeeppuvvadi4433
    @sandeeppuvvadi4433 3 หลายเดือนก่อน

    A much simpler approach
    long profit = 0;
    for(int i=0;i values[i]){
    profit = profit + (values[i+1]-values[i]);
    }
    }
    return profit;

  • @tasneemayham974
    @tasneemayham974 8 หลายเดือนก่อน

    Best TEacher Everr!!!

  • @adityapatel_00
    @adityapatel_00 10 หลายเดือนก่อน +2

    I don't know why this code works but... I think it is the most optimal code so far.
    long profit=0;
    for(int i=0;i

    • @nihalsingh6233
      @nihalsingh6233 9 หลายเดือนก่อน +1

      This is the greedy approch.
      Institution is very simple : If the stock's price is increased tomorrow as compare to today, we will buy it and in last we will return our total sum

  • @mayanksamadhiya8908
    @mayanksamadhiya8908 ปีที่แล้ว

    We can also do this with just using single 2 size array that we have learnt....... Thanks Striver

  • @santoshb7776
    @santoshb7776 7 หลายเดือนก่อน

    Understood sir !!🙏🙏

  • @Bhaskarjyoti02
    @Bhaskarjyoti02 ปีที่แล้ว

    It can also be optimized to one array i.e two variables.

  • @SunnyGuptaTech
    @SunnyGuptaTech ปีที่แล้ว

    The way you have explained this is pretty awesome. Keep up the good work Raj bhai. Thank you once again.

  • @jaythadeshwar8436
    @jaythadeshwar8436 ปีที่แล้ว

    Beautifully explained, cannot be better !!!

  • @rohitanand7071
    @rohitanand7071 29 วันที่ผ่านมา

    Understood
    Also there is no need to carry cur array

  • @pulkitagrawal1456
    @pulkitagrawal1456 2 ปีที่แล้ว

    It can be solved like the previous question easily too
    class Solution {
    public:
    int maxProfit(vector& prices) {
    int ans = 0;
    int mini = prices[0];
    int n = prices.size();
    int profit;
    int prev = mini;
    for(int i = 1; i < n; i++)
    {
    profit = prices[i] - mini;
    if(profit > 0)
    ans = ans + profit;
    mini = prices[i];
    }
    return ans;
    }
    };

  • @ethanhunt8001
    @ethanhunt8001 2 ปีที่แล้ว +3

    You have no idea how eagerly I was waiting for videos

  • @ajaybabupatel1665
    @ajaybabupatel1665 ปีที่แล้ว +1

    Striver you lied that it's one of best DP series available!
    Its not one of Best its THE BEST.
    Thanks a lot MAN.

  • @saurabhrthakur
    @saurabhrthakur 3 หลายเดือนก่อน

    Understood!

  • @jessji1295
    @jessji1295 11 หลายเดือนก่อน

    Thank you for your videos! I just found you and I'll def go over all of your videos but I have interviews coming up soon and need to understand the Memoization (optimization part) first. I'm wondering which video I should go for for memoization (optimization part)? is DP 1 intruduction video the right one? Thanks in advance.

  • @RakeshKumar-rn3rz
    @RakeshKumar-rn3rz 2 ปีที่แล้ว

    thanku soo much for this nice playlist of dp .

  • @cypher7536
    @cypher7536 2 ปีที่แล้ว +1

    OMG!!!!!!! excellent optimisation...👌👌

  • @prateeksharma3698
    @prateeksharma3698 2 ปีที่แล้ว +6

    Solution's journey is very exciting , and yes I understood the problem.

  • @chitranshjain5075
    @chitranshjain5075 2 ปีที่แล้ว

    Thank you very much for your efforts.
    Really appreciate It sir

  • @nikhilsrivastava7719
    @nikhilsrivastava7719 ปีที่แล้ว

    Understood Amazing!
    But this works too
    int maxProfit(vector& prices) {
    int profit = 0;
    int n = prices.size();
    for (int i = 1; i < n; i++) {
    if (prices[i] > prices[i - 1])
    profit += prices[i] - prices[i - 1];
    }
    return profit;
    }

  • @pankajmittal1002
    @pankajmittal1002 2 หลายเดือนก่อน

    understood!!

  • @UECAshutoshKumar
    @UECAshutoshKumar 21 วันที่ผ่านมา +1

    Understood!!!

  • @tusharnain6652
    @tusharnain6652 2 ปีที่แล้ว

    You can also use greedy, it's more optimal in this problem, below is c++ code
    int maxProfit(vector& prices) {
    int profit = 0;
    for(int i = 0; i < prices.size()-1; i++)
    if(prices[i] < prices[i+1])
    profit += prices[i+1] - prices[i];
    return profit;
    }

    • @rishabhkumar8115
      @rishabhkumar8115 2 ปีที่แล้ว

      but how it works. Give some proofs as well

    • @tusharnain6652
      @tusharnain6652 2 ปีที่แล้ว

      @@rishabhkumar8115 whenever you see that arr[i+1] is more than arr[i], consider trading, that's it.

    • @rishabhkumar8115
      @rishabhkumar8115 2 ปีที่แล้ว

      @@tusharnain6652 but there is no uniformicity of data. there is possibility of getting more profite by selling current stock on other day after (i+1)th day.

    • @tusharnain6652
      @tusharnain6652 2 ปีที่แล้ว

      @@rishabhkumar8115 yes, you're right.
      Damn, they should add more testcases.

    • @jatinmalhotra2325
      @jatinmalhotra2325 ปีที่แล้ว

      ​@@rishabhkumar8115 True there is a possibility of getting more profit by selling current stock on other say after (i+1)th day but that will still result in same net profit.
      consider a case like [p1 p2 p3] where p1< p2

  • @niteshkushwaha9493
    @niteshkushwaha9493 11 หลายเดือนก่อน

    It's all about understanding this question and all of it's variations can be easily solved.

  • @AshishKumar-ww1mr
    @AshishKumar-ww1mr ปีที่แล้ว

    I have said it multiple times , its just about understanding recursive approach -> rest is literally cake walk down to the space optimization

  • @devanshrai8972
    @devanshrai8972 ปีที่แล้ว +1

    This can be solved without dp
    class Solution {
    public:
    #define loop(i, l, n) for (int i = l; i = n; i--)
    int maxProfit(vector& prices)
    {
    int ans = 0;
    int n = prices.size();
    loop(i,1,n-1)
    {
    if(prices[i]>prices[i-1])
    {
    ans+=prices[i]-prices[i-1];
    }
    }
    return ans;
    }
    };

  • @technologybaba192
    @technologybaba192 3 หลายเดือนก่อน

    Understoood

  • @jimspatel2407
    @jimspatel2407 2 ปีที่แล้ว

    Fully understand !! 🔥
    Thanks striver 😊😊

  • @parvahuja7618
    @parvahuja7618 2 หลายเดือนก่อน

    thankyou sir

  • @pardhi8959
    @pardhi8959 3 หลายเดือนก่อน

    Understood.

  • @TheDev05
    @TheDev05 ปีที่แล้ว

    Can also be done with single array or just 2 variables.

  • @ManishSahu-fu5ml
    @ManishSahu-fu5ml 4 หลายเดือนก่อน

    understood 🙏

  • @pranjalthapliyal2278
    @pranjalthapliyal2278 3 หลายเดือนก่อน

    Understood :)

  • @satendra6200
    @satendra6200 9 หลายเดือนก่อน +1

    Here you can sell the stock and then you can buy the same stock on the same day(if it is less than the next stock price) i.e same index value act as the selling as well as buying.....correct me if i'm wrong

  • @srinathv1412
    @srinathv1412 6 หลายเดือนก่อน

    Understood !!!!!

  • @crazyduniya128
    @crazyduniya128 11 หลายเดือนก่อน +1

    26:33 Same thing I did in the last two lines. No Words❤‍🔥

  • @pragyanandsingh6673
    @pragyanandsingh6673 4 หลายเดือนก่อน

    Understood !!

  • @stephenh7788
    @stephenh7788 หลายเดือนก่อน

    @takeUforward
    please explain the below code:-
    class Solution {
    public:
    int maxProfit(vector& prices) {
    int n=prices.size();
    vector dp(2,0);
    for(int ind=n-1;ind>=0;ind--){
    dp[0]=max(dp[1]+prices[ind],dp[0]);
    dp[1]=max(dp[0]-prices[ind],dp[1]);
    }
    return dp[1];
    }
    };

  • @joshrak3412
    @joshrak3412 ปีที่แล้ว +1

    I think two array space optimisation is more readable and easier than 4 variable space optimisation..

  • @chetanraghavv
    @chetanraghavv 2 ปีที่แล้ว

    Since curr[j] was only dependent on ahead[0] and ahead[1], we could further optimize this to a single array of size 2. In that way, we would have done this with just 2 variables. But for that inner loop will be from left to right i.e. 0 to 1 instead of 1 to 0 in normal space optimization and tabulation.

    • @takeUforward
      @takeUforward  2 ปีที่แล้ว +4

      Learnt from prev video hn? Impressive ♥️

    • @chetanraghavv
      @chetanraghavv 2 ปีที่แล้ว

      @@takeUforward All thanks to you! 😁♥️

  • @googleit2490
    @googleit2490 8 หลายเดือนก่อน

    Done and dusted in the DP revision :)
    (1 min)
    Nov'17, 2023 10:21 pm

  • @hrituraj5973
    @hrituraj5973 9 หลายเดือนก่อน

    understood

  • @dhanashreegodase4445
    @dhanashreegodase4445 7 หลายเดือนก่อน +2

    why we returned dp[0][1] in tabulation? by not dp[0][0]

    • @studynewthings1727
      @studynewthings1727 3 หลายเดือนก่อน +1

      Because 1 indicates you can purchase stock, you don't have any stock to sell, whereas 0 represents to sell the holded stock. Meaning with dp[0][0] meaning you are carrying the profit(i.e. answer) with some stocks yet to sell. Therefore returning dp[0][1]

  • @ratanprakash8075
    @ratanprakash8075 23 วันที่ผ่านมา

    I solved it using JUST 2 VARIABLES. Most space optimised simple solution.

  • @nihalsingh6233
    @nihalsingh6233 9 หลายเดือนก่อน

    Understood

  • @divyachopra2369
    @divyachopra2369 ปีที่แล้ว +1

    int max_profit=0;
    for(int i=1;i

  • @ratinderpalsingh5909
    @ratinderpalsingh5909 ปีที่แล้ว

    Understood, sir. Thank you very much.

  • @harshit_nimesh
    @harshit_nimesh 6 หลายเดือนก่อน

    The below one seemed a reasonable approach to me when I first saw the question and had no idea about DP and all. And it works in o(n).
    if (n == 0) return 0;
    if(n == 2){
    if (p[1] > p[0]) return p[1]-p[0];
    else return 0;
    }
    long profit = 0;
    for (int i = 0; i < n-1 ; i++){
    int j = i;
    while(j < n-1 && p[j+1] > p[j]){
    j++;
    }
    profit += p[j]-p[i];
    i = j;
    }
    return profit;

  • @sudiptvyas4536
    @sudiptvyas4536 11 หลายเดือนก่อน

    Understood. You explained really well!

  • @KuldeepSingh-yo7sh
    @KuldeepSingh-yo7sh 4 หลายเดือนก่อน +1

    i love you bro

  • @ayushgupta80
    @ayushgupta80 11 หลายเดือนก่อน

    if(n ==0) return 0;
    long buy = values[0];
    long res = 0;

    for(int i =1;i values[i]) {
    res += values[i-1] - buy;
    buy = values[i];
    }
    }
    return max(res,res + values[n-1]-buy);
    most optimised

  • @dennisdavis9896
    @dennisdavis9896 ปีที่แล้ว

    How can I create a data structure for buying and selling the stocks on my own?

  • @aamirarshad4536
    @aamirarshad4536 ปีที่แล้ว

    greedy approach
    if(prices.size()==0){return 0;}
    int profit=0;
    for(int i=0;iprices[i]){profit+=prices[i+1]-prices[i];}
    }
    return profit;

  • @vatsalvasoya5243
    @vatsalvasoya5243 ปีที่แล้ว

    Understood!! very well explained!!!

  • @GungunRamchandani
    @GungunRamchandani 14 วันที่ผ่านมา

    mindBlowingggggggggggggggg

  • @sauravchandra10
    @sauravchandra10 ปีที่แล้ว

    Understood clearly, thanks!

  • @r.s.k1301
    @r.s.k1301 ปีที่แล้ว

    int maxProfit = 0;
    for(int i=1;iprices[i-1]){
    maxProfit+=prices[i]-prices[i-1];
    }
    }
    return maxProfit;
    this is better right?

  • @karthikmenon1608
    @karthikmenon1608 2 ปีที่แล้ว

    so when we sell cant we buy on the same day again which eq takes care of that because after selling we are going to next index directly so we wont be able to buy on same day.

  • @rishabhkumar8115
    @rishabhkumar8115 2 ปีที่แล้ว

    Nice one bro. Space optimization is lit

  • @rakshithannaldesh7207
    @rakshithannaldesh7207 ปีที่แล้ว

    long profit=0;
    for(int i=0;i

  • @bite091_jamee7
    @bite091_jamee7 ปีที่แล้ว

    ur lectures are amazing sir

  • @manjunathg.s5967
    @manjunathg.s5967 ปีที่แล้ว

    Understood!!! Amazing content!!!

  • @NikhilGupta-zo5jh
    @NikhilGupta-zo5jh 2 ปีที่แล้ว

    Back to the previous days of dp on subsequences :)
    Understood

  • @shreyashachoudhary480
    @shreyashachoudhary480 2 ปีที่แล้ว +2

    Indeed understood!

  • @meghanshmundra1070
    @meghanshmundra1070 2 ปีที่แล้ว +3

    NOTES ARE NOT THERE FOR THIS LECTURE??????? NOTES ARE NOT UPLOADED AFTER LECTURE 34

  • @juniorboy1903
    @juniorboy1903 2 ปีที่แล้ว +1

    Understood bhaiya love this series😍😃

  • @abhilashbharata5833
    @abhilashbharata5833 ปีที่แล้ว

    understood brother!! great explanation