629. K Inverse Pairs Array | DP + Sliding Window | Recursion to Bottom Up Optimised ++
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
If this Problem is asked in an Interview. All the best from my side 🫠🥲!!
Your Explanation is very good !!
My brain broke trying to think. Thank god you are there.
Crazy efforts and thought process!
Thanks for making our lives easier!
The best explanation I have ever watched! Great job!
Bhaiya esika intezarr ker reha tha😂
First Comment, kya baat ❤ !!
Thanks for putting in-"In case if you missed it" !😃
Great Explanation bro ❤❤
great explanation , Thanks.
Waiting for your vedio...😊
First Comment, Yaayy 🥰 !!
nice explaination. thanks
Thank-You !!!
Excellent explanation 👏
Hats off to your efforts and explanation. Really loved the video. !!
Excellent explanation bhai 🙌
great explanation
beautiful
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
If this question asked , run away and prepare for next interview.
this is why hard questions scare me :)
how many year of exprience do you have thanks for teachig us
Hey!! Can u please share these slides also. Please it would be of great help
Bro can you solve Reverse nodes in k group leetcode 25
Can you suggest similar problems related to this concepts?
Atcoder dp contest t
sir can you private the pdf format what you showing (dray run - diagram ...)
13:15 fucking over action but No explanation
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?
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 🫡❤ !!
@@ARYANMITTAL thanks for the guidance ❤️
@@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
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.
how can a human think of the solution in the interview??
Bro 8th class? 😀 ICSE MEI THA KYA BHAI?