Groups of Strings| Leeetcode 2157 | Contest 278 | Union Find Bit Manipulation 🔥 🔥 🔥

preview_player
Показать описание
Here is the solution to "Groups of Strings" leetcode question. Hope you have a great time going through it.

1) 0:00 Explaining the problem out loud
2) 1:50 Understanding the Algorithm
3) 2:00 Approach
3) 12:00 Coding it up

🔥🔥🔥🔥👇👇👇 For discussion/feedback/humour/doubts/new openings

🔴 Checkout the series: 🔥🔥🔥

🔥🔥🔥 Leetcode Monthly Contest Playlist

PS : Please increase the speed to 1.25X
Рекомендации по теме
Комментарии
Автор

could you please dry run of the code you wrote? And in union find you are making parent whose size is smaller, but in optimized code we make parent whose size is bigger.

angadrajsingh
Автор

Great content. Thank you for doing this.

Just one small suggestion. Please also discuss time/space complexity at the end since that plays an important part.

nehagupta-opsi
Автор

It is difficult to understand the code line by line. Rather you should use diagram to show what is happening data wise.

prasat
Автор

I converted this algorithm into C++, and it gives TLE. FYI.

NoName-iptt
Автор

I did not know about union find. So intuitively I thought of forming a graph like structure and connecting nodes with each other, then performing a dfs/bfs to find all connected nodes. Wasn't able to code my approach though as I am weak in converting solution into code

ritvikjoshi
join shbcf.ru