Find K Pairs with Smallest Sums II Min Heap II Priority Queue II Merge k Sorted List II Leetcode 373

In this video, I'll talk about how to solve Leetcode 373. Find K Pairs with Smallest Sums II Min Heap II Priority Queue II Merge k Sorted List
Checkout DSA-169 Series: • Aryan DSA-169 Series |...
Problem Link: leetcode.com/problems/find-k-...
Code & Notes: drive.google.com/file/d/1mhYl...
Let's Connect:
📝Linkedin: / aryan-mittal-0077
📸 Instagram: / aryan_mittal_007
📱Telegram : t.me/aryan_mittal_group
🤖 Github: github.com/aryan-0077
🛍️ Products I use in Videos: (✨ Marked for Mostly requested Products)
Main Camera (Canon 200D ii): amzn.to/41cfS5h
Vlog Camera (iphone 13): amzn.to/42aOJRh
Tripod for Lectures: amzn.to/3HMoloF
Tripod for Vlogs: amzn.to/44wGL6L
✨Mic: amzn.to/41bj8gU
Shadow Multi Colour Light: amzn.to/41bmIrq
Main Light: amzn.to/3LF6BNb
Tripod for Lights: amzn.to/3LFcQAt
Softbox for Lights: amzn.to/42mHqWE
✨My Pen Tablet for Notes: amzn.to/44A61ZJ
✨New Tablet for Notes: amzn.to/44BjTDa
Tablet Stand: amzn.to/3NMFIJR
Power Bank: amzn.to/421yHsZ
✨USB Hub: amzn.to/3p8NGTf
✨HardDisk to store Lectures: amzn.to/3HKafEs
✨My Laptop: amzn.to/44w12ct
✨My Monitor: amzn.to/3LCG6YL
My UPS: amzn.to/3Lydy2y
My UPS old: amzn.to/3LXT0C3
✨My Mouse: amzn.to/3LYmJdY
✨My Keyboard: amzn.to/3NJs4ah
Resources you can try:
Learn Coding: • Complete RoadMap for C...
🎥Channel Playlists
🎥 Baap Graph Series - by Aryan: • Baap Graph Series - by...
🎥Dynamic Programming: • Complete Dynamic Progr...
🎥Bit Manipulation: • Complete BIT MANIPULAT...
🎥Mathematics for DSA: • Complete Mathematics f...
🎥Leetcode Top Interview Questions: • FAANG & Leetcode Inter...
🎥Codeforces Problem B Ladder: • Complete PROBLEM B LAD...
🎥Codeforces Problem C Ladder: • Codeforces PROBLEM C L...
🎥Codeforces Problem D Ladder: • Complete PROBLEM D LAD...
🎥 Top 150 Interview Questions: • Top 150 Interview Ques...
🎥 Complete Array Problem Playlist: • Complete Array Intuit...
🎥 Complete Binary Search Problem Playlist: • Complete Binary Search...
🎥 Complete Stack Playlist: • Complete Stack & Queue...
🎥 Complete Graph Problem Playlist: • Complete Graph Intuiti...
🎥 Complete TREE Playlist: • Complete TREE Intuitio...
🎥 Complete DP Problem Solving: • Complete DP Intuition ...
🎥 Complete Linked List: • Complete Linked List I...
🎥 Complete Greedy Problem Playlist: • Complete Greedy Intui...
🎥 Complete Divide & Conquer Algorithm Playlist: • Complete Divide & Conq...
🎥 Complete Trie Playlist: • Complete Trie Intuitio...
🎥 Complete Mathematics & Number Theory Problems: • Complete Mathematics &...
About Channel:
We teach about how you can grow in life & educate about programming in Fun & Intuitional way.
About Me:
I am Aryan Mittal - a Software Engineer, Speaker, Creator & Educator. During my free time, I create programming education content on this channel & also how to use that to grow :)
✨ Timelines✨
✨ Hashtags ✨
#programming #Interviews #leetcode #faang #maang #datastructures #algorithms

Пікірлер: 31

  • @ARYANMITTAL
    @ARYANMITTAL Жыл бұрын

    This one is Medium level but for Intuition Building is one of the best Problems 🙈 Checkout DSA-169 Series: kzread.info/dash/bejne/Z3aprbiMXbnUp9Y.html Problem Link: leetcode.com/problems/find-k-pairs-with-smallest-sums/description/ Code & Notes: drive.google.com/file/d/1mhYlmkID6sMtyEcTSs1z6rCOWY-d10CG/view?usp=sharing

  • @adithyang6672
    @adithyang667211 ай бұрын

    Bhai acche dance karte hoo aur explain bhi😁

  • @rohanchoudhary5523
    @rohanchoudhary5523 Жыл бұрын

    Amazing explanation , i knew it was a min heap question but couldn't figure out how to apply it , brute force gave tle and mle

  • @harshit8525
    @harshit8525Күн бұрын

    not able to open the drive link

  • @MP-ny3ep
    @MP-ny3ep Жыл бұрын

    Terrific explanation. Thank you!

  • @Knani-hb4tr
    @Knani-hb4tr10 ай бұрын

    Superrrrr❤

  • @prashantkumar6268
    @prashantkumar62682 ай бұрын

    Finally understood the intuition.

  • @vaibhavbansal8164
    @vaibhavbansal8164 Жыл бұрын

    Awesome explanation. Thanks dude🙌

  • @shwetanshusood9450
    @shwetanshusood9450 Жыл бұрын

    Hi bro, what can be the optimal code for given question? There are N people who have already participated. The official has noted their weight and has ranked them. The problem is, he has fallen sick and there are still P people who are left to rank and participate. Considering this, you are expected to finish the process and provide the rank of the P people. Once the person is ranked, his weight is included in the category and the weight of the new person will have to consider this weight also to be ranked. To help you out, the new P people are organized in a queue in increasing order of their weights. Input Format The first line of input consists of two space-separated integers, N and P, number of people already ranked and number of people left to be ranked respectively. The second line of input consists of N space-separated integers arranged in decreasing order, representing the weight of the N people. The third line of input consists of P space-separated integers arranged in increasing order, representing the weight of the P people. Constraints 1

  • @soumyajitmishra6855
    @soumyajitmishra6855 Жыл бұрын

    Aryan's code matches to that of other peeps

  • @KishoreKumar-tm5ig
    @KishoreKumar-tm5ig Жыл бұрын

    Consider the test case: nums1[1,2,3,4] nums2[1,10], k=2 for this the above approach gives incorrect answer right? As it considers only first k elements from the first list

  • @ok-google-run

    @ok-google-run

    3 ай бұрын

    I think it also takes the rows into consideration

  • @ramprasath3818

    @ramprasath3818

    Ай бұрын

    No the code works fine ig. Initially we will have (1, 1), (2, 1) on the pq, 1) (1, 1) gets popped and added to res. (1, nums2[1]) => (1, 10) is pushed. 2) (2, 1) gets popped and added to res. Nothing will get pushed as we are at the end of the row. K = 0, and the ans is correct.

  • @naitikdixit6726
    @naitikdixit6726 Жыл бұрын

    Amazing solution sir ji ❤

  • @aditimahabole1761
    @aditimahabole1761 Жыл бұрын

    you are so amazingggggg!!!!!!

  • @alienx2367
    @alienx2367 Жыл бұрын

    You got that charm on your face man !

  • @vloggerop1370
    @vloggerop13709 ай бұрын

    Loved it

  • @arghyadas4138
    @arghyadas4138 Жыл бұрын

    From the first list you are taking only 'k' elements, and Inside the while loop you are increasing the 'iterator' or 2nd list. Soo the values after kth element in list 1 are never getting used🤔 How do you know that we have to neglect them?

  • @piyush9409

    @piyush9409

    Жыл бұрын

    bcz the arrays are sorted if we find are answers then no need go go further as sthe sum increases

  • @itspurelypassionate
    @itspurelypassionate7 ай бұрын

    Amazing !!

  • @ARYANMITTAL

    @ARYANMITTAL

    7 ай бұрын

    Thank you so much ❤️🫡

  • @rimurutempest2130
    @rimurutempest2130 Жыл бұрын

    I just realized that this doesn't work for negative numbers -10 ^ 5 Correct me if wrong . Sorry maybe it will work not sure .

  • @Aysh_Sach_16-2
    @Aysh_Sach_16-2 Жыл бұрын

    VLOGS UPLOAD KRO BHAI

  • @krishnasharma657
    @krishnasharma657 Жыл бұрын

    Sad it didn't workout🥲

  • @anexocelisia9377
    @anexocelisia9377 Жыл бұрын

    aaj ka lc?

  • @leftover3857
    @leftover3857Ай бұрын

    striver ne padhaya hota to kabhi yeh video kholni na padti. Jhel raha hu jaise taise

  • @Stefan_2117

    @Stefan_2117

    6 күн бұрын

    😂

  • @harshsharma9322
    @harshsharma9322 Жыл бұрын

    but..but...but...

  • @googlePowerful452
    @googlePowerful4528 ай бұрын

    Bhai tum kya code explainer ke chote bhai ho 😂 ?

  • @abhishekanand2163
    @abhishekanand2163 Жыл бұрын

    very confused

  • @Rupeksha-we1jn
    @Rupeksha-we1jn5 ай бұрын

    Explanation:240p

Келесі