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
---------------------------------------------------------------------------------------------------------------------------
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
understood
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.
understood ,but for this solution even after knowing it is a DSU question such implementation is tough
The best explanation. I was able to code it on my own as soon as you explained the approach.
this problem was awesome for my brain. Thank u so much for making it so clear striver understood
understood! with such a clarity.
was not able to figure it out whether its DSU qs or not
understood💙💙💙
just enjoying this amazing graph series
superb explanation ❤
Understood! Super amazing explanation as always, thank you very much!!
Understood ❤
the intuition has been explained excellently
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....
understood. you are brilliant in finding suitable examples to make us understood❤
Hell of a code . Amazing explanation
The way you explained the problem is simply mind blowing.... thanks bhaiyaa 💌
Understood!!
For this particular video, need to revise
watched it twice!! but now understood it
Very good explanation, it makes life easy
Thank You so much striver bhaiyya for this amazing Graph Series !!
Understood
Awesome explanation 🔥
Ye new and unique question tha bhaiya, understood.
understood. I solved it on my own just bcoz of ur awsome disjoint explanation video :)
Thanku striver for giving such a great content.
brilliant explaination, thanks a lot striver
This series is Totally dope.. Thank You Striver.. ok ok forgot to write.. "UNDERSTOOD"
understood! Great explanation.
its a tough one for sure but understood ur explaination , i need some time to digest it though
awesome explanation Understood sir
Brilliant Explanation
Thanks Striver. This problem is hard af even if you know its DSU
Thank You So Much for this wonderful video.........🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
Great explanation 🔥
Hey Striver
Thank you for such wonderful explanation!!!:)
you are amazing Striver 🙌🙌
Very nice explanation bhaiya! Thanks
Great Explanation
Awesome explanation bhaiya 🔥
Great explanation sir
understood maja aaa gya 😎😎🔥🔥
GOATED dsa mentor/teacher. Understood.
Thanks so much striver!!!!
Amazing explanation
Thanks a lot.
Nice video keep on making such videos.
Awesome Content!!
understood bhaiya❣
very nice explantion sir
On second rewatch, understood it better.
understood
no way i am going to guess this is a DSU question without prior practice
Disjoint set does these merging things pretty easy.
Understood Sir!
Thank you sir 😊
"US" BHAIYA .....whenever the heart is broken....video dekh dekh kr song yaad ho gya hai
your*
Understood 👍
Understood ❤
Understood❤
Understood✌️
understood!!!
Thanks🙌
understood💖💖
understood!
understoood!!!
understood🙌
Understood!!
Understood.
Understood:)
UNDERSTOOD
Understood!
I have subscribed bro
striver since the map(incase of ordered map) already stores the mails in the sorted order
is sorting the mail is neccessary?
Understood
Thanks by heart
Understood!
GFG doesn't take output in any order but Leetcode does, bug is there in GFG for this problem. I coded in python
understood
They made it hard after strivers video
Done!
Damn this was tough
How can we come up to this type of solution of our own.
nice
hard one, but understood
yes
how does this code handle repeating mails?
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
Supreme.
Striver why don't we directly set the ultimate parent in the hashmap itself?
The problem is , If it wasn't mentioned DSU anywhere, I wouldn't have thought anything apart from maps and sets.
why i am getting wa at 56 in gfg
I cant solve it w/o seeing soln is it okay and normal ?
Time complexity?
Is this doable in an interview
inspiration for tier 3 college students
Understoood R
It was HARD until Striver explaination
isme instead of vectormergeMail[n] hum 2d vector of string le sakte hein kya?
same question
yes you can, in that case you' ll use it as vector mergeMail(n);
yeah he is using array of vectors , u can use vector of vector in place of that
Time complexity??
do you uses mouse ?
bro i can solve dsa based problem only if i know the topics they belong(identifying the qn),bro how can i overcome this
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;
And The Issue was resolved by the gfg customer care they increased time limit for the problem. Any way thankyou for this content
🎉🎉🎉
submit the solution to problem named accounts merge, merging details has some problem with test case 3 and test case 56
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.
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());
Dhanyavaad
Bro, can you explain what is actually happening here????
@@ayushanand6957 sorting in descending order ig
What is the reason behind this extra greater function?
It gives wrong ans for some other test cases.
it is showing runtime error
Just think for a moment you did not open this quen w/o learning graphs ! Were you able to solve this ??????