G-50. Accounts Merge - DSU

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ต.ค. 2022
  • GfG-Problem Link: bit.ly/3sl2Xia
    C++/Java/Codes and Notes Link: takeuforward.org/data-structu...
    DP Series: • Striver's Dynamic Prog...
    SDE Sheet: takeuforward.org/interviews/s...
    Check out our Website for curated resources:
    Our Second Channel: / @striver_79
    In case you are thinking to buy courses, please check below:
    Code "takeuforward" for 15% off at GFG: practice.geeksforgeeks.org/co...
    Code "takeuforward" for 20% off on sys-design: get.interviewready.io?_aff=takeuforward
    Crypto, I use the Wazirx app: wazirx.com/invite/xexnpc4u
    Take 750 rs free Amazon Stock from me: indmoney.onelink.me/RmHC/idje...
    Earn 100 rs by making a Grow Account for investing: app.groww.in/v3cO/8hu879t0
    Linkedin/Instagram/Telegram: linktr.ee/takeUforward
    ---------------------------------------------------------------------------------------------------------------------------

ความคิดเห็น • 189

  • @takeUforward
    @takeUforward  ปีที่แล้ว +30

    Let's continue the habit of commenting “understood” if you got the entire video. Please give it a like too,.
    Do follow me on Instagram: striver_79

  • @kritikarawat2180
    @kritikarawat2180 ปีที่แล้ว +68

    I feel you are the best graph teacher bcz after watching graph videos in this channel i didnt looked at any other channel to understand any question.

  • @rishabhgupta9846
    @rishabhgupta9846 ปีที่แล้ว +36

    understood ,but for this solution even after knowing it is a DSU question such implementation is tough

  • @vishious14
    @vishious14 8 หลายเดือนก่อน +7

    The best explanation. I was able to code it on my own as soon as you explained the approach.

  • @1tav0
    @1tav0 ปีที่แล้ว +9

    this problem was awesome for my brain. Thank u so much for making it so clear striver understood

  • @lakshsinghania
    @lakshsinghania ปีที่แล้ว +3

    understood! with such a clarity.
    was not able to figure it out whether its DSU qs or not

  • @p38_amankuldeep75
    @p38_amankuldeep75 ปีที่แล้ว +7

    understood💙💙💙
    just enjoying this amazing graph series
    superb explanation ❤

  • @cinime
    @cinime ปีที่แล้ว +4

    Understood! Super amazing explanation as always, thank you very much!!

  • @LBK3
    @LBK3 ปีที่แล้ว +5

    Understood ❤
    the intuition has been explained excellently

  • @arjundutta1515
    @arjundutta1515 2 หลายเดือนก่อน +1

    I've explored a lot of youtube videos to understand graph. No one can exaplain with such a clarity and concept.
    I was also able to do similar kind of problems after learning the pattern. Greate playlist....

  • @aruna5869
    @aruna5869 7 หลายเดือนก่อน +2

    understood. you are brilliant in finding suitable examples to make us understood❤

  • @beinghappy9223
    @beinghappy9223 ปีที่แล้ว +10

    Hell of a code . Amazing explanation

  • @manishkarmakar3927
    @manishkarmakar3927 7 หลายเดือนก่อน

    The way you explained the problem is simply mind blowing.... thanks bhaiyaa 💌

  • @SumitKeshariMCS
    @SumitKeshariMCS ปีที่แล้ว +1

    Understood!!
    For this particular video, need to revise

  • @sukhpreetsingh5200
    @sukhpreetsingh5200 ปีที่แล้ว +5

    watched it twice!! but now understood it

  • @nirupamkumar6760
    @nirupamkumar6760 ปีที่แล้ว

    Very good explanation, it makes life easy

  • @Sumeet_100
    @Sumeet_100 ปีที่แล้ว

    Thank You so much striver bhaiyya for this amazing Graph Series !!

  • @adityaagarwal2324
    @adityaagarwal2324 ปีที่แล้ว +1

    Understood
    Awesome explanation 🔥

  • @amanbhadani8840
    @amanbhadani8840 ปีที่แล้ว

    Ye new and unique question tha bhaiya, understood.

  • @sarankumaar6009
    @sarankumaar6009 ปีที่แล้ว

    understood. I solved it on my own just bcoz of ur awsome disjoint explanation video :)

  • @sapna2019
    @sapna2019 ปีที่แล้ว +1

    Thanku striver for giving such a great content.

  • @user-kl3qv1sc8k
    @user-kl3qv1sc8k หลายเดือนก่อน

    brilliant explaination, thanks a lot striver

  • @Chandraprakash-kx4ic
    @Chandraprakash-kx4ic ปีที่แล้ว +1

    This series is Totally dope.. Thank You Striver.. ok ok forgot to write.. "UNDERSTOOD"

  • @r_uhi05
    @r_uhi05 4 หลายเดือนก่อน

    understood! Great explanation.

  • @Sahil1001
    @Sahil1001 10 หลายเดือนก่อน +1

    its a tough one for sure but understood ur explaination , i need some time to digest it though

  • @shubhamkumar3198
    @shubhamkumar3198 ปีที่แล้ว

    awesome explanation Understood sir

  • @iamnoob7593
    @iamnoob7593 8 หลายเดือนก่อน

    Brilliant Explanation

  • @Moch117
    @Moch117 9 หลายเดือนก่อน +1

    Thanks Striver. This problem is hard af even if you know its DSU

  • @stith_pragya
    @stith_pragya 7 หลายเดือนก่อน +1

    Thank You So Much for this wonderful video.........🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻

  • @sunilpanchal1498
    @sunilpanchal1498 ปีที่แล้ว

    Great explanation 🔥

  • @mathy642
    @mathy642 8 หลายเดือนก่อน

    Hey Striver
    Thank you for such wonderful explanation!!!:)

  • @factsworlda2k547
    @factsworlda2k547 4 หลายเดือนก่อน

    you are amazing Striver 🙌🙌

  • @shitizgoel5027
    @shitizgoel5027 7 หลายเดือนก่อน

    Very nice explanation bhaiya! Thanks

  • @abhishek__anand__
    @abhishek__anand__ ปีที่แล้ว

    Great Explanation

  • @shivanshumishra0560
    @shivanshumishra0560 ปีที่แล้ว

    Awesome explanation bhaiya 🔥

  • @onlysparsh
    @onlysparsh ปีที่แล้ว

    Great explanation sir

  • @kshitijmishra2716
    @kshitijmishra2716 ปีที่แล้ว

    understood maja aaa gya 😎😎🔥🔥

  • @mbm.editzz
    @mbm.editzz 7 หลายเดือนก่อน

    GOATED dsa mentor/teacher. Understood.

  • @adebisisheriff159
    @adebisisheriff159 6 หลายเดือนก่อน

    Thanks so much striver!!!!

  • @SunnyKumar-dw9ze
    @SunnyKumar-dw9ze 9 หลายเดือนก่อน

    Amazing explanation

  • @paragroy5359
    @paragroy5359 5 หลายเดือนก่อน

    Thanks a lot.
    Nice video keep on making such videos.
    Awesome Content!!

  • @suryasingh2563
    @suryasingh2563 ปีที่แล้ว

    understood bhaiya❣

  • @MCA_HimanshuSeth
    @MCA_HimanshuSeth ปีที่แล้ว

    very nice explantion sir

  • @rushidesai2836
    @rushidesai2836 4 หลายเดือนก่อน

    On second rewatch, understood it better.

  • @Rajat_maurya
    @Rajat_maurya ปีที่แล้ว +15

    understood
    no way i am going to guess this is a DSU question without prior practice

  • @muditkhanna8164
    @muditkhanna8164 10 หลายเดือนก่อน

    Disjoint set does these merging things pretty easy.

  • @parshchoradia9909
    @parshchoradia9909 ปีที่แล้ว

    Understood Sir!

  • @UECAshutoshKumar
    @UECAshutoshKumar 7 หลายเดือนก่อน +1

    Thank you sir 😊

  • @uknowme48
    @uknowme48 ปีที่แล้ว +2

    "US" BHAIYA .....whenever the heart is broken....video dekh dekh kr song yaad ho gya hai

  • @-VLaharika
    @-VLaharika ปีที่แล้ว

    Understood 👍

  • @sairam3351
    @sairam3351 8 หลายเดือนก่อน

    Understood ❤

  • @suryakiran2970
    @suryakiran2970 ปีที่แล้ว

    Understood❤

  • @ACUCSPRADEEPB-up9ne
    @ACUCSPRADEEPB-up9ne ปีที่แล้ว

    Understood✌️

  • @tiyaroy4714
    @tiyaroy4714 17 วันที่ผ่านมา

    understood!!!

  • @herculean6748
    @herculean6748 ปีที่แล้ว

    Thanks🙌

  • @japkiratsingh3728
    @japkiratsingh3728 ปีที่แล้ว

    understood💖💖

  • @saseerak8763
    @saseerak8763 ปีที่แล้ว

    understood!

  • @bhavya8608
    @bhavya8608 ปีที่แล้ว

    understoood!!!

  • @prajjwalgurjar3887
    @prajjwalgurjar3887 ปีที่แล้ว

    understood🙌

  • @vatsalvasoya5243
    @vatsalvasoya5243 ปีที่แล้ว

    Understood!!

  • @manasranjanmahapatra3729
    @manasranjanmahapatra3729 ปีที่แล้ว

    Understood.

  • @dreamyme543
    @dreamyme543 ปีที่แล้ว

    Understood:)

  • @rounakmukherjee9540
    @rounakmukherjee9540 ปีที่แล้ว

    UNDERSTOOD

  • @RituSingh-ne1mk
    @RituSingh-ne1mk 6 หลายเดือนก่อน

    Understood!

  • @priyankkumawat4405
    @priyankkumawat4405 ปีที่แล้ว

    I have subscribed bro

  • @World-Of-Mr-Motivater
    @World-Of-Mr-Motivater หลายเดือนก่อน +1

    striver since the map(incase of ordered map) already stores the mails in the sorted order
    is sorting the mail is neccessary?

  • @sanamdeepsingh7914
    @sanamdeepsingh7914 ปีที่แล้ว

    Understood

  • @shaliniguptaietlucknow2301
    @shaliniguptaietlucknow2301 ปีที่แล้ว

    Thanks by heart

  • @ayushman_sr
    @ayushman_sr 2 หลายเดือนก่อน

    GFG doesn't take output in any order but Leetcode does, bug is there in GFG for this problem. I coded in python

  • @a2_63_vimalmishra9
    @a2_63_vimalmishra9 ปีที่แล้ว

    understood

  • @MadhavGupta-fi2tu
    @MadhavGupta-fi2tu ปีที่แล้ว +1

    They made it hard after strivers video

  • @girikgarg8
    @girikgarg8 ปีที่แล้ว

    Done!

  • @rishabhranjan5162
    @rishabhranjan5162 หลายเดือนก่อน

    Damn this was tough

  • @ApnaVlogs-tj7do
    @ApnaVlogs-tj7do 9 หลายเดือนก่อน +1

    How can we come up to this type of solution of our own.

  • @nishantdehariya5769
    @nishantdehariya5769 4 หลายเดือนก่อน

    nice

  • @ahmedzaidi4228
    @ahmedzaidi4228 ปีที่แล้ว

    hard one, but understood

  • @akashsahu2571
    @akashsahu2571 ปีที่แล้ว

    yes

  • @after_dark_777
    @after_dark_777 3 หลายเดือนก่อน

    how does this code handle repeating mails?

  • @shivarajput9719
    @shivarajput9719 6 หลายเดือนก่อน

    In the example you are saying 3 ka ultimate parent is 0, but if 0 index name is john and 3rd index name is ram then in the list it will store john -> all emails, ideally instead of john there will be ram. In the code it is showing correct because 0 ka ultimate parent is 3. @takeUforward

  • @ashishkumaryadav5252
    @ashishkumaryadav5252 ปีที่แล้ว +1

    Supreme.

  • @averylazyandweirdhuman
    @averylazyandweirdhuman หลายเดือนก่อน

    Striver why don't we directly set the ultimate parent in the hashmap itself?

  • @Xp-Sam
    @Xp-Sam 5 หลายเดือนก่อน +1

    The problem is , If it wasn't mentioned DSU anywhere, I wouldn't have thought anything apart from maps and sets.

  • @a2_63_vimalmishra9
    @a2_63_vimalmishra9 ปีที่แล้ว +1

    why i am getting wa at 56 in gfg

  • @user-gs2hy8by9h
    @user-gs2hy8by9h หลายเดือนก่อน

    I cant solve it w/o seeing soln is it okay and normal ?

  • @DevanshuAugusty
    @DevanshuAugusty ปีที่แล้ว

    Time complexity?

  • @omop5922
    @omop5922 ปีที่แล้ว

    Is this doable in an interview

  • @steverogers1657
    @steverogers1657 9 หลายเดือนก่อน +1

    inspiration for tier 3 college students

  • @aryankumar3018
    @aryankumar3018 ปีที่แล้ว

    Understoood R

  • @valarmorghulis9244
    @valarmorghulis9244 11 หลายเดือนก่อน

    It was HARD until Striver explaination

  • @krishanpratap3286
    @krishanpratap3286 ปีที่แล้ว +1

    isme instead of vectormergeMail[n] hum 2d vector of string le sakte hein kya?

    • @itsaryanb9316
      @itsaryanb9316 ปีที่แล้ว

      same question

    • @yt_deepx
      @yt_deepx ปีที่แล้ว +2

      yes you can, in that case you' ll use it as vector mergeMail(n);

    • @lakshsinghania
      @lakshsinghania ปีที่แล้ว

      yeah he is using array of vectors , u can use vector of vector in place of that

  • @sohammukherjee1392
    @sohammukherjee1392 ปีที่แล้ว

    Time complexity??

  • @NiteshKumar-xm3nq
    @NiteshKumar-xm3nq วันที่ผ่านมา

    do you uses mouse ?

  • @santhoshreddy2603
    @santhoshreddy2603 2 หลายเดือนก่อน

    bro i can solve dsa based problem only if i know the topics they belong(identifying the qn),bro how can i overcome this

  • @vigneshreddy1213
    @vigneshreddy1213 2 หลายเดือนก่อน

    Hey Striver at Present the number of test cases were increased to 1151 then the intution you suggested suceeded till 400 change test cases can you make another video for avoidance of tle;

    • @vigneshreddy1213
      @vigneshreddy1213 2 หลายเดือนก่อน

      And The Issue was resolved by the gfg customer care they increased time limit for the problem. Any way thankyou for this content

  • @pratyakshhhhhhhhhhhhhhhhhhhhh
    @pratyakshhhhhhhhhhhhhhhhhhhhh 7 หลายเดือนก่อน

    🎉🎉🎉

  • @vishalbairagi5364
    @vishalbairagi5364 17 วันที่ผ่านมา

    submit the solution to problem named accounts merge, merging details has some problem with test case 3 and test case 56

  • @Shengdanya
    @Shengdanya ปีที่แล้ว

    how are we supposed to code sooo much in such short time. If it comes in coding test, we have to solve other questions as well. Amazing explanation tho.

  • @PrajwalKakade
    @PrajwalKakade ปีที่แล้ว +11

    Those are getting WA on 56 on GFG, just sort the ans by adding this line before return statement.
    sort(ans.begin(), ans.end(), greater());

    • @manishpawar5918
      @manishpawar5918 ปีที่แล้ว

      Dhanyavaad

    • @ayushanand6957
      @ayushanand6957 ปีที่แล้ว

      Bro, can you explain what is actually happening here????

    • @priyanksinha8152
      @priyanksinha8152 ปีที่แล้ว +1

      @@ayushanand6957 sorting in descending order ig

    • @sauravchandra10
      @sauravchandra10 ปีที่แล้ว

      What is the reason behind this extra greater function?

    • @neilsagarsahu7306
      @neilsagarsahu7306 ปีที่แล้ว

      It gives wrong ans for some other test cases.

  • @shreyarawatvlogs6920
    @shreyarawatvlogs6920 6 หลายเดือนก่อน

    it is showing runtime error

  • @user-gs2hy8by9h
    @user-gs2hy8by9h หลายเดือนก่อน

    Just think for a moment you did not open this quen w/o learning graphs ! Were you able to solve this ??????