Dynamic Programming in one shot | shashcode dp | shashcode dynamic programming | dsa | dp hindi

Поділитися
Вставка
  • Опубліковано 31 січ 2025

КОМЕНТАРІ • 141

  • @shashwat_tiwari_st
    @shashwat_tiwari_st  29 днів тому +2

    Hey guys, there are 2 mistakes in this video. I did these mistakes while copy pasting..
    22:43 - line 16 should be dp[n] = recur(n-1) + recur(n-2)
    Remember to store the same recursion call. If you use fib still you will get the answer but the number of states stored will be little more.. sorry for this copy paste mistake.
    40:37 - same mistake.
    It should be
    dp[n] = recur(n-1) + recur(n-2)
    I have corrected the code in github and mentioned the mistake as well.

    • @keepquit6925
      @keepquit6925 14 днів тому

      Bro create Greedy Algo based too , we are waiting ,

  • @shashwat_tiwari_st
    @shashwat_tiwari_st  Місяць тому +29

    Yeh dp ki sare standard problems and patterns the❤
    Agar iska part 2 chahiye (20 questions more) toh 1K likes krne honge iss video pr.. Ab aap decide kro, aapko video chahiye toh like krna pdega 🎉

  • @shashwat_tiwari_st
    @shashwat_tiwari_st  Місяць тому +14

    Please please like this video and share it over the internet!!!🤩🤩

  • @Sudhdesidance
    @Sudhdesidance Місяць тому +15

    12:27 -> Fibonacci Number
    33:23 -> Climbing Stairs
    47:37 -> Counting Bits
    1:02:14 - > Min Cost Climbing Stairs
    1:21:31 -> House Robber
    1:49:14 -> House Robber Il
    2:22:32 -> Perfect Sum Problem
    2:54:57 -> 0/1 Knapsack
    3:47:46 ->Coin Change
    3:52:17 -> Rod Cutting
    4:09:02 -> Longest Common Subsequence
    4:32:02 -> Longest Palindromic Subsequence
    4:38:12 -> Shortest Common Supersequence
    4:49:57 -> Longest Increasing Subsequence
    5:24:18 -> Maximum Length of pair Chain
    5:31:03 -> Dp on gride/Matrix
    5:49:19 -> Unique Paths

    • @priyanshukumar6679
      @priyanshukumar6679 Місяць тому +2

      Thanx it helps a lot to look for specific questions 😄😄😄😄🫂🫂🫂

  • @gurutavpatel6835
    @gurutavpatel6835 21 день тому +1

    bhaiya your content is just amazing best instructor

  • @SHIVAMSINGH-bl1hk
    @SHIVAMSINGH-bl1hk Місяць тому +2

    Freaking Legend...need to complete it before new year tho..
    thanks man!!!!

  • @jigarmori1119
    @jigarmori1119 29 днів тому +1

    Clear and easy explanation. Verry verry verry helpful. Thank you!!!!!!!!!!!!!

  • @tejas2636
    @tejas2636 Місяць тому +4

    I can guarantee that this will be most helpful legit video even before watching the video..😊 Thank you so much bhaiyya ❤

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому +1

      Thankyou tejas❤ Thankyou ❤, agar aapko video psnd aaye toh please aur logo ke sath share kare, hmare bhaut jada help ho jaege🎉

  • @PrashantKumar-bp4gb
    @PrashantKumar-bp4gb 28 днів тому +2

    Great content. I noticed that in some parts of this video, I get the same voice from the background for the exa: timestamp, which is around 57- 59 minutes.

  • @pratikingole628
    @pratikingole628 10 днів тому

    Thank you Bhaiyyaaaa..for htis epic dp one shot video.I was got stuck on since november 24.now I understood all the dp topics very deeply..!!!!😌🤗

  • @kidnamedfinger8627
    @kidnamedfinger8627 Місяць тому +1

    Thanks a lot bhaiya!
    And Merry Christmas!!!

  • @harshthakre1700
    @harshthakre1700 24 дні тому +1

    thanku so much sir great video.

  • @kunalsarpal7564
    @kunalsarpal7564 Місяць тому +4

    Thanks!❤❤❤

  • @abd9641
    @abd9641 13 днів тому

    Great Explanation! Do not get demotivated by less likes, views or subscribers . Upload part2 as well , you will get more reach . And thank you :)

  • @MotivationalMantra-dg9qi
    @MotivationalMantra-dg9qi Місяць тому

    Much needed video 🙏🙏🙏

  • @nanddaclub3972
    @nanddaclub3972 21 день тому +1

    Thank your so much❤

  • @ShubhamSharma-sf8wk
    @ShubhamSharma-sf8wk Місяць тому +2

    Mannnnn what a timing, I was looking for a playlist focusing on DP from scratch, Thanks a lot Tiwari bhai

  • @harshthakre1700
    @harshthakre1700 22 дні тому +1

    sir its request to upload the 2nd part as soon as you can...kudos to your efforts sir..❤💛🧡

  • @bangaliconnection
    @bangaliconnection Місяць тому

    Amazing content, Thank you so much❤ Will share with everyone i know who is interested in coding

  • @shrutiagrawal529
    @shrutiagrawal529 Місяць тому

    Thanks for all the videos, really helpful! :)

  • @Official_Saint
    @Official_Saint Місяць тому

    Was waiting for so long. Merry Christmas sir🎉❤

  • @suravighosal9934
    @suravighosal9934 Місяць тому

    Thank you so much for this video. Really helpful

  • @sushantsingh7924
    @sushantsingh7924 Місяць тому

    Sir Ji Thank You 🫡💕💕💕💕💕💕 Best Content Bhaiya

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому +2

      Thankyou ❤, agar aapko video psnd aaye toh please aur logo ke sath share kare, hmare bhaut jada help ho jaege🎉

  • @ankanabiswas6548
    @ankanabiswas6548 Місяць тому

    Sir..... You are the best🤩🤩🤩🤩🤩🤩🤩

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому

      Thankyou ❤, agar aapko video psnd aaye toh please aur logo ke sath share kare, hmare bhaut jada help ho jaege🎉

  • @opkrchauhan_1
    @opkrchauhan_1 4 дні тому

    Good Playlist

  • @keepquit6925
    @keepquit6925 14 днів тому

    Litreally Good content , i saw Kunal Khushwaha type content is this , like i am not saying it in bad way but both are best now ,

  • @abhijitmanna4524
    @abhijitmanna4524 Місяць тому +1

    Amazing 🎉🎉

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому

      Thankyou ❤, agar aapko video psnd aaye toh please aur logo ke sath share kare, hmare bhaut jada help ho jaege🎉

    • @codeDudee
      @codeDudee Місяць тому

      Abi exam hai baad Mai dekhu ga thanks

  • @ayush4820
    @ayush4820 Місяць тому +1

    Bhai ayse he one shot late raho hamara support bana hay aapko. bahut acha dp padhaya hay aapne pure consept clear ho gye , thank you bhaiya

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому +1

      ❤❤ thankyou brother, aap share kre aur logo ke sath please, hmare bhaut help ho jaege

    • @ayush4820
      @ayush4820 Місяць тому

      @shashwat_tiwari_st ji bhaiya mene to jitne bhi mere sath vale java se DSA kar rahe hai sabko apka suggestion diya hai aur unko bhi apka samjhane tarika achha laga . Bas aap ayse he one shot aur daily question late rahiye.

  • @HA000_edits
    @HA000_edits 4 дні тому

    Sir isme apne matrix chain multiplication wale pattern nahi karavae but thanks for this this is really helpful ❤️

  • @mohit.j5554
    @mohit.j5554 Місяць тому +1

    Thank you sir ji❤

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому +1

      @@mohit.j5554 Thankyou ❤, agar aapko video psnd aaye toh please aur logo ke sath share kare, hmare bhaut jada help ho jaege🎉

  • @Quark2632
    @Quark2632 Місяць тому

    Love you shashwat sir ❤

  • @learnerz123
    @learnerz123 День тому

    LIS mai to next level maza aa gya

  • @ahsan4u2u
    @ahsan4u2u Місяць тому +1

    Hatts of your hard work and commitment to deliver this level of content free ❤❤

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому +1

      Thankyou ❤, agar aapko video psnd aaye toh please aur logo ke sath share kare, hmare bhaut jada help ho jaege🎉🎉

  • @YashChandanshiv-xf5kg
    @YashChandanshiv-xf5kg Місяць тому +1

    thank you

  • @Aman-u2i8x
    @Aman-u2i8x 27 днів тому +2

    bhaiya greedy algorithm ke liye bhi video banao pure u tube pe java me greedy algorithm pe videos hi nhi h

  • @sakshimish14
    @sakshimish14 Місяць тому +1

    I am sure this is one of the best dp video ❤

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому

      Thankyou ❤, agar aapko video psnd aaye toh please aur logo ke sath share kare, hmare bhaut jada help ho jaege🎉

  • @user-ct7bh9po6c
    @user-ct7bh9po6c Місяць тому

    Thank you brother for this helpful vedio....

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому +1

      Thankyou ❤, agar aapko video psnd aaye toh please aur logo ke sath share kare, hmare bhaut jada help ho jaege🎉

    • @user-ct7bh9po6c
      @user-ct7bh9po6c Місяць тому

      @shashwat_tiwari_st ji bhaiya

  • @MOD_Podcast_
    @MOD_Podcast_ 6 днів тому

    sir reels post kara karo ... jisse apki social reach bade , Daily question of leetcode ki reel daal sakte ho aap .. usse kafi reach aa jaygi apki .... and 1 min concept video reel ....aapka content to kaafi achha hain bas reach nahi h .. wo shyad yahi sab kare se aaygi

  • @MohammedHasmi577
    @MohammedHasmi577 Місяць тому

    Tysm 👍🙏 sir

  • @karthik-varma-1579
    @karthik-varma-1579 14 днів тому

    🔥

  • @mr.nishantawasthi4402
    @mr.nishantawasthi4402 Місяць тому

    Osm sir ❤

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому

      Thankyou ❤, agar aapko video psnd aaye toh please aur logo ke sath share kare, hmare bhaut jada help ho jaege🎉

  • @AjaySoni-u6w
    @AjaySoni-u6w Місяць тому

    Much needed Thank you!!!

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому

      Thankyou ❤, agar aapko video psnd aaye toh please aur logo ke sath share kare, hmare bhaut jada help ho jaege🎉

  • @sauravsrivastav1249
    @sauravsrivastav1249 Місяць тому

    sir you did mistake in Memoization Approach in question 1st and 2nd that is why you got TLE 41:35
    Error was you did not change the method name

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому

      Are..haa line 29 me recur hoga. 😓😓, thanks mai github pr change kr deta hu.. thanks for pointing

  • @SH_987
    @SH_987 Місяць тому

    Just WOW ❤❤❤❤❤❤🎉🎉🎉🎉🎉🎉 THANKS BHAIYA ❤️

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому +1

      Dhanyawad, please aap aur logo ke sath bhi share kare, hmare bhaut help ho jaege❤❤

  • @sumeetsamsam
    @sumeetsamsam Місяць тому

    Thanks.

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому

      Thankyou ❤, agar aapko video psnd aaye toh please aur logo ke sath share kare, hmare bhaut jada help ho jaege🎉

  • @BhavikAjmera
    @BhavikAjmera 29 днів тому

    Shashwat bhai First Question Fibonacci Number The Dp Is Use Like This
    public int fib(int n) {
    int[] dp = new int[n+1];
    Arrays.fill(dp,-1);
    return recursion(dp, n);
    }
    int recursion(int[] dp, int n){
    if(n

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  29 днів тому +1

      Ha shi bol rhe ho, maine copy paste kiya toh change krna miss hogya, jo maine kra usse bhi answer aaega but unnecessary extra space bharega. Aapka code shi hai ek baar pinned comment bhi dekh lena mera.

  • @bhushanambhore8378
    @bhushanambhore8378 Місяць тому +3

    Thank u so much, but i was expecting it as dp playlist.

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому +1

      Thankyou ❤, please see the pinned comment, hope it helps!

  • @tornovdutta
    @tornovdutta Місяць тому +1

    Thank you for this video . I am looking for this type video in youtube and you just post it.

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому +1

      ❤️❤️ thankyou, agar aapko video psnd aaye ho toh please aur logo ke sath share kare, hmare bhaut hi jada help ho jaege🎉

  • @VaibhavSingh_code
    @VaibhavSingh_code Місяць тому

    bhaiya thanks

  • @sharansc-h9t
    @sharansc-h9t Місяць тому

    Thank you sir, I was looking for one hardly from few days

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому

      Thankyou ❤, agar aapko video psnd aaye toh please aur logo ke sath share kare, hmare bhaut jada help ho jaege🎉

    • @sharansc-h9t
      @sharansc-h9t Місяць тому

      @shashwat_tiwari_st zaroor sir

  • @aryatyagi3518
    @aryatyagi3518 Місяць тому

    thanku sir ji

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому

      Thankyou ❤, agar aapko video psnd aaye toh please aur logo ke sath share kare, hmare bhaut jada help ho jaege🎉

    • @aryatyagi3518
      @aryatyagi3518 Місяць тому

      @shashwat_tiwari_st sure sir

  • @SMS_news
    @SMS_news Місяць тому

    Can all video will marge this type an go in one shot... Like this topic tree, graph, stack,queue...etc ...go on one shot

  • @ankitatiwary4663
    @ankitatiwary4663 Місяць тому

    Thanks ❤

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому

      Thankyou ❤, agar aapko video psnd aaye toh please aur logo ke sath share kare, hmare bhaut jada help ho jaege🎉

  • @manjeet4418
    @manjeet4418 Місяць тому +2

    Thanks Bhaiya❤

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому +1

      Thankyou ❤, agar aapko video psnd aaye toh please aur logo ke sath share kare, hmare bhaut jada help ho jaege🎉

  • @sumeetsamsam
    @sumeetsamsam Місяць тому

    Unfortunately, we can give only one thumbs even on such good videos.

  • @shubhamprasad7127
    @shubhamprasad7127 Місяць тому

    Thank you bhaiya, great video

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому

      Thankyou ❤, agar aapko video psnd aaye toh please aur logo ke sath share kare, hmare bhaut jada help ho jaege🎉

  • @suravighosal9934
    @suravighosal9934 Місяць тому

    Sir when will the 2nd part come?

  • @jawedhawari6927
    @jawedhawari6927 Місяць тому

    🤩🤩🤩🤩

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому

      Thankyou ❤, agar aapko video psnd aaye toh please aur logo ke sath share kare, hmare bhaut jada help ho jaege🎉

  • @choudhryaysha8816
    @choudhryaysha8816 Місяць тому +2

    First comment 🎉❤

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому +1

      Thankyou ❤, agar aapko video psnd aaye toh please aur logo ke sath share kare, hmare bhaut jada help ho jaege🎉

  • @pranavamali05
    @pranavamali05 Місяць тому

    👌

  • @opshorts3205
    @opshorts3205 Місяць тому +1

    Bhiyaa thnkuuu , dp pdhna tha muje but java k 1 stop dp ni milra tha n aaj boom bhyiii bhut bhut shukriyaa apkaa🎉❤

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому

      Ji bilkul ❤ agar video psnd aaye toh aur logo ke sath share kre ❤ hmare bhaut jada help ho jaege

  • @DarkDragon-bz6qp
    @DarkDragon-bz6qp Місяць тому +1

    Please add timestamps.. Thanks for the video

  • @gurutavpatel6835
    @gurutavpatel6835 21 день тому

    paer 2 bhaiya please

  • @mr.nishantawasthi4402
    @mr.nishantawasthi4402 Місяць тому

    Please solve more questions sir 🙏🙏🙏 second part one short

    • @mr.nishantawasthi4402
      @mr.nishantawasthi4402 Місяць тому

      Please reply

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому +2

      ​@@mr.nishantawasthi4402 all patterns are covered.
      If you want more videos, please see the pinned comment ❤

  • @SoumyaMishra11
    @SoumyaMishra11 Місяць тому

    Those questions are awesome but Shashwat only 19 questions are not more enough, need something more in this.

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому +1

      Hey Soumya, these are standard patterns asked in interviews.
      If you want more problems, please check pinned comment❤

  • @navneettripathi2110
    @navneettripathi2110 Місяць тому +1

    First viewer, last learner

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому

      Thankyou ❤, agar aapko video psnd aaye toh please aur logo ke sath share kare, hmare bhaut jada help ho jaege🎉

  • @ritusundaram4070
    @ritusundaram4070 12 днів тому

    waiting for greedy algo series

  • @dayashankarlakhotia4943
    @dayashankarlakhotia4943 Місяць тому

    public int lengthOfLIS(int[]nums){
    if(nums==null||nums.length==0) return 0;
    int[]dp=new int[nums.length];
    dp[0]=nums[0];
    int len=0;
    for(int i=1;idp[len]){
    dp[++len]=nums[i];
    }else{
    int idx=binarySearch(dp,len,nums[i])
    dp[idx]=nums[i];
    return len+1;
    }
    private int binarySearch(int[]dp,int end,int target){
    int s=0;
    while(s

  • @is_Debu
    @is_Debu Місяць тому

    Thank your sir best X-mas gift for us. ❤🥹
    Much love and respect to you sir putting this the type of content free for us.🙏🥹

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому

      Thank you for the love ❤, your support means a lot! 🙏

  • @dayashankarlakhotia4943
    @dayashankarlakhotia4943 Місяць тому

    public int uniquePathsWithObstacles(int[][]grid){
    int m=grid.length,n=grid[0].length;
    int[]dp=new int[n];
    dp[0]=grid[0][0]==0?1:0;
    for(int i=0;i

  • @dayashankarlakhotia4943
    @dayashankarlakhotia4943 Місяць тому

    public int perfectSum(int[]nums,int target){
    int[]dp=new int[target+1];
    dp[0]=1;
    for(int i=0;i=0;j--){
    if(j>=nums[i])
    dp[j]=(dp[j]+dp[j-nums[i]]);
    }
    return dp[target];
    static int knapsack(int capacity,int[]values,int[]wt){
    int[]dp=new int[capacity+1];
    int n=wt.length;
    for(int i=0;i=wt[i];j--){
    dp[j]=Math.max(dp[j],dp[j-wt[i]]+val[i]);
    }
    return dp[capacity];
    }
    🎉❤

  • @akhandbharatmission3639
    @akhandbharatmission3639 Місяць тому

    bhaiya dsa ke sarre topic karva dijeye

  • @UdayIge-28
    @UdayIge-28 Місяць тому +6

    Vote for same one shot of greedy, two pointer and divided and conquer

    • @utkrishtsneh8298
      @utkrishtsneh8298 Місяць тому

      two pointer in already there in a playlist

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  Місяць тому

      Thankyou ❤, agar aapko video psnd aaye toh please aur logo ke sath share kare, hmare bhaut jada help ho jaege🎉

    • @UdayIge-28
      @UdayIge-28 Місяць тому

      @shashwat_tiwari_st definitely bhaiya
      Love you 3000 🌹

    • @UdayIge-28
      @UdayIge-28 Місяць тому

      @@utkrishtsneh8298 but link is not provided in excel sheet

  • @is_Debu
    @is_Debu Місяць тому

    Jaldi se downloads kar leta hu key pata delete ho jae.😅

  • @chris-p-bacon1053
    @chris-p-bacon1053 Місяць тому

    Sir, kambali bai chahiye. 6000 rupee mahina. Khana pina free. Agar acha kam kiya to month end me Old Monk dunga. Koi hey kya apne najar me?