629. K Inverse Pairs Array | DP + Sliding Window | Recursion to Bottom Up Optimised ++

Sdílet
Vložit
  • čas přidán 9. 07. 2024
  • In this video, I'll talk about how to solve Leetcode 629. K Inverse Pairs Array | DP + Sliding Window
    Checkout DSA-169 Series: • Aryan DSA-169 Series |...
    100Days 100k Placements: • 100 Days 100K Placement
    Let's Connect:
    📝Linkedin: / aryan-mittal-0077
    📸 Instagram: / ez.pz.dsa
    📱Telegram : t.me/aryan_mittal_group
    🤖 Github: github.com/aryan-0077
    About Me:
    I am Aryan Mittal - A Software Engineer in Goldman Sachs, Speaker, Creator & Educator. During my free time, I create programming education content on this channel & also how to use that to grow :)
    ✨ Timelines✨
    0:00 - Bakwas
    0:25 - Problem Explanation
    3:18 - Brute Force
    5:19 - Brute Force Optimised
    8:08 - Intuition of Solution
    16:58 - Recursion + Memoization
    22:37 - Bottom Up
    25:00 - Bottom Up Time Optimised
    43:00 - Bottom Up Time & Space Both Optimised
    ✨ Hashtags ✨
    #programming #Interviews #leetcode #faang #maang #datastructures #algorithms

Komentáře • 36

  • @ARYANMITTAL
    @ARYANMITTAL  Před 5 měsíci +42

    If this Problem is asked in an Interview. All the best from my side 🫠🥲!!

    • @Sumeet_100
      @Sumeet_100 Před 5 měsíci +5

      Your Explanation is very good !!

  • @debarkochaudhuri2765
    @debarkochaudhuri2765 Před 5 měsíci +10

    My brain broke trying to think. Thank god you are there.

  • @parthbarai2818
    @parthbarai2818 Před 5 měsíci +5

    Crazy efforts and thought process!
    Thanks for making our lives easier!

  • @GoodLuck-dv2zu
    @GoodLuck-dv2zu Před 4 měsíci

    The best explanation I have ever watched! Great job!

  • @infinitygaming7192
    @infinitygaming7192 Před 5 měsíci +10

    Bhaiya esika intezarr ker reha tha😂

  • @user-xc6ez1kj6q
    @user-xc6ez1kj6q Před 5 měsíci

    Thanks for putting in-"In case if you missed it" !😃

  • @prathameshbhujbal4069
    @prathameshbhujbal4069 Před 5 měsíci +1

    Great Explanation bro ❤❤

  • @architjain7071
    @architjain7071 Před 5 měsíci

    great explanation , Thanks.

  • @user-rx7ok4bo7z
    @user-rx7ok4bo7z Před 5 měsíci +5

    Waiting for your vedio...😊

  • @abhinay.k
    @abhinay.k Před 5 měsíci

    nice explaination. thanks

  • @asthajain2511
    @asthajain2511 Před 5 měsíci

    Thank-You !!!

  • @MATTUPALLINVSGKESAVAKUMARBCE

    Excellent explanation 👏

  • @amanpatel8575
    @amanpatel8575 Před 5 měsíci

    Hats off to your efforts and explanation. Really loved the video. !!

  • @rameshsmcs074
    @rameshsmcs074 Před 5 měsíci

    Excellent explanation bhai 🙌

  • @sarankumaar6009
    @sarankumaar6009 Před 5 měsíci

    great explanation

  • @kiransequeira8902
    @kiransequeira8902 Před 5 měsíci

    beautiful

  • @karankaira
    @karankaira Před 5 měsíci

    correct me if i am wrong, can we consider value of f(0,0) equal to 1 ? bcoz f(0,0) says how many permutation having 0 inversions with 0 elements ... we have empty permutation that can be counted as the only one possible .
    So in recursion solution the base case will now have a order
    if (k==0 ) return 1;
    if (n==0 ) return 0 ;
    this will be the order now for base case to occur .
    Even tho , case of f(0,0) will never occur , k == 0 should get more priority because permutation with 0 inversions is always possible which is 1, 2, ... n and incase of n == 0 , it is empty permutation
    then these base cases can be easily setup in tabulation with all rows with k == 0 , put dp[i][0] = 1; where 0

  • @rohitkumaram
    @rohitkumaram Před 5 měsíci +2

    If this question asked , run away and prepare for next interview.

  • @vijaybenz9741
    @vijaybenz9741 Před 5 měsíci

    this is why hard questions scare me :)

  • @govindlohar6816
    @govindlohar6816 Před 5 měsíci

    how many year of exprience do you have thanks for teachig us

  • @6mahine_mein_google
    @6mahine_mein_google Před 5 měsíci

    Hey!! Can u please share these slides also. Please it would be of great help

  • @Nerddog12344
    @Nerddog12344 Před 5 měsíci

    Bro can you solve Reverse nodes in k group leetcode 25

  • @_A__Mohit
    @_A__Mohit Před 5 měsíci +2

    Can you suggest similar problems related to this concepts?

  • @user-sp8ne7hj3n
    @user-sp8ne7hj3n Před 5 měsíci

    sir can you private the pdf format what you showing (dray run - diagram ...)

  • @Anonymous____________A721

    13:15 fucking over action but No explanation

  • @harshal8781
    @harshal8781 Před 5 měsíci +3

    i am not able to build logic for maximum questions of daily leetcode questions, always have to refer intuition and after watching it I think "aacha ye to aise karna tha" , what should I do start DSA from scratch again or anything else?

    • @ARYANMITTAL
      @ARYANMITTAL  Před 5 měsíci +20

      Bhai recently the problems are actually a bit tricky & hard, many a times i also feel, acchaa ye bhi toh ho sakta hai !! - But still 80% of things are familiar, now this familiarity comes by seeing same sub-problems or similar problems again & again. Bro, ye highly normal hai, "accha ye tha isme" - this is every Programmers line after he reads a hint or solution, toh apan ko ghabrana nhi hai 🫡❤ !!

    • @harshal8781
      @harshal8781 Před 5 měsíci

      @@ARYANMITTAL thanks for the guidance ❤️

    • @gingfreecss2885
      @gingfreecss2885 Před 5 měsíci

      @@ARYANMITTALwahi bhaiya sometimes even i start questioning myself if i should go back to start from 0, haven’t seen the concept before , even if i tried i still wouldnt be able to do it if i sat for 4 days

  • @deepikakala7745
    @deepikakala7745 Před 5 měsíci

    I am unable to get intuition to create a solution , I always have to watch some solution . Is there any ordered series which can be helpful to understand this type of problem.

  • @unknown47896
    @unknown47896 Před 5 měsíci

    how can a human think of the solution in the interview??

  • @lilgainz
    @lilgainz Před 5 měsíci

    Bro 8th class? 😀 ICSE MEI THA KYA BHAI?