Rare but "MUST KNOW" DP Concept 🔥| 3409. Longest Subsequence With Decreasing Adjacent Difference |

Поделиться
HTML-код
  • Опубликовано: 22 янв 2025

Комментарии • 31

  • @ARYANMITTAL
    @ARYANMITTAL  18 дней назад +2

    Short - ruclips.net/user/shorts_Gb8CiwqdsY?feature=share

  • @shubhamlahoti9758
    @shubhamlahoti9758 14 дней назад +5

    I miss the days when I could solve the medium probs real quick, lately most of them feel super hard. :o

  • @andr3w321
    @andr3w321 18 дней назад +10

    Couldn't follow tbh. Need less explaining and more dry running of a small simple example.

    • @ARYANMITTAL
      @ARYANMITTAL  18 дней назад +11

      By my experience some problems shouldn’t be understood by dry run & this is one such problem. (Apart from suffixMax portion, which can be understood by dry run)
      This problem involved “how to reach” & “why to use” a specific technique, if you have watched video maximum twice & had a copy pen with you while i was explaining, & still this isn’t understandable, then i might recommend solving more dp medium problems first (apart from those so called sheet problems)

  • @instinct1098
    @instinct1098 8 дней назад

    Genius, just genius....I understood the solution but after watching twice. But it would be really great if you would include dry running on a sample

  • @fraserdab
    @fraserdab 18 дней назад +2

    good morning welcome back....at night 11:30 anyways thanks for upload

  • @Its_Shubham_Negi
    @Its_Shubham_Negi 18 дней назад +1

    Finally it's here!! ❤❤

  • @mukulkhanna5071
    @mukulkhanna5071 17 дней назад +1

    best video like always

  • @PrajwalCoding
    @PrajwalCoding 16 дней назад +2

    Will this question be easy with push dp than pull dp?

  • @moazgamal1429
    @moazgamal1429 17 дней назад

    thanks man, really great effort.

  • @sudeepgupta5104
    @sudeepgupta5104 12 дней назад

    I was doing inTC= length of Array*300*300

  • @luizfelipe2330
    @luizfelipe2330 15 дней назад

    I see that you tried really hard, to explaining this. But the problem itself is very confusing :X.
    I'll watch this video later a couple of times to see if I can understand.

  • @ajayc815
    @ajayc815 17 дней назад

    watched almost 5 times 😃😃

  • @cse_33_ayandutta48
    @cse_33_ayandutta48 18 дней назад

    Could you please explain the 4th one,cause this only question is challenging

  • @Anonymous____________A721
    @Anonymous____________A721 18 дней назад

    🔥🔥

  • @shan_singh
    @shan_singh 11 дней назад

    I am trying to do this using recursive solution, can someone help me check why my logic is wrong?
    class Solution {
    public:
    int findSubSeq(vector& nums, int curr, int prev, int diff){
    if(curr>=nums.size()) return 0;
    int take=0, leave=0, neww=0;
    leave = findSubSeq(nums, curr+1, prev, diff);
    if(prev!=-1 && nums[curr]-nums[prev]

    • @rockpaperscissors1781
      @rockpaperscissors1781 9 дней назад

      Check with this.. But don't submit unless you want to choke leetcode servers on memory and get slapped in return..
      class Solution {
      int solve(int idx, int diff, int last_ele_idx, vector& nums, vector& dp){
      if(idx == nums.size()) return 0;
      if(dp[idx][diff][last_ele_idx] != -1) return dp[idx][diff][last_ele_idx];
      int ans = 0;
      if(abs(nums[idx] - nums[last_ele_idx])

  • @Mad_Monk29
    @Mad_Monk29 17 дней назад

    i have a doubt isnt 1e8 works under time limit ..?? , btw nice editorial

    • @dhruvdangi8923
      @dhruvdangi8923 12 дней назад

      no it doesn't, it only works till 1e5

  • @ajayc815
    @ajayc815 18 дней назад

    🥰🥰🥰🥰

  • @ajayc815
    @ajayc815 18 дней назад

    🥰🥰🥰🥰🥰🥰🥰

  • @JeetuKumar-wd1uw
    @JeetuKumar-wd1uw 18 дней назад

    Bhai recursion wala code bhi bata do sarh mai

    • @ARYANMITTAL
      @ARYANMITTAL  18 дней назад +2

      Bhai full video dekho pata chal jaaega, why top down is super tricky here & bottom up much simpler🫂

  • @sukhpreetsingh5200
    @sukhpreetsingh5200 18 дней назад

    🔥🔥🔥