Ep10- Subset II problem | Find all UNIQUE subsets of an array with duplicate elements | Recursion

preview_player
Показать описание
In the lecture number 7 of the recursion series, we saw how to find all the subsets of an array, but in this lecture we will see, how to find all UNIQUE subsets of an array with duplicate elements. Make sure that you watch lecture no.7 before watching this video.

Pre-requisites:-

1. Ep7 - Find all the Subsets of an array

To get all updates follow on Instagram

👨‍💻Utilize free courses, DSA sheet, and articles on Lead Coding website at

Join our telegram channel for all the important announcements

✨ Hashtags ✨
#DSA #Recursion #Placement #Fraz
Рекомендации по теме
Комментарии
Автор

Summary of the lecture:
1. In Subsets-I, we have all the elements as unique. That's why our Pick and Don't Pick conditions were working fine.
2. In Subsets-II, we will have duplicate elements. But we want our final ans to contain only unique subsets.
3. We can achieve it by counting only one occurrence of an element and skipping all its rest occurrences in arr[]
4. We need to first sort the given vector arr[]
5. For don't pick condition, we will first check whether arr[i]==arr[i+1] or not. If so, we will ignore the rest occurrences of that particular element.
5. Time and Space Complexity will remain same[in worst case we will have unique elements only]

arghya_
Автор

I have always feared recursion but your way of teaching has made it so easy. Thank you so much for this extremely well explained video.

InfiniteCuriosity
Автор

Hey, Thanks for this playlist. I always had issues in understanding recursion problems. The main thing I liked about your playlist is that you have added prerequisites for all the videos. If I'm not able to understand something I know what I'm lacking currently and can refer the videos in the prerequisites. This made even the concepts I never understood over months of leetcoding now. Thanks a lot !

avinashb
Автор

I did not understand this from other's solutions. But this approach made me understand, its much easier and intuitive

sword
Автор

just learned a new way to approach this problem.. best one till now

priyanshusrivastava
Автор

watched so many videos on this, but you explained really well brother without making it complex

VijenderSingh-wrfm
Автор

When someone says how to master recursion then i send them the link of your channel. The best playlist of recursion on you fraz bhaiya for providing these quality of thank you ..My IDEAL..🙏🙏🙏🙏

mukeshkir
Автор

In the beginning, I was not able to understand, I have also commented on the 7th video that it's difficult to understand, but today even before the video started I was able to code a recursive on my own, That's because of you bhiaya.
Thank you so much bhaiya.

de_ansh
Автор

Bhaiya thank you so can say this is the best playlist of recursion so far

Ji-yoon
Автор

day by day, lectures are getting more interesting. Good video. Waiting for tomorrow.

ranitbandyopadhyay
Автор

This is very helpful lecture, I watched n number of videos but this make me understand where we are making the duplicate subsets

pratika-prakhar
Автор

At last, I've found what I was looking for. Thank you so much.

rhosen
Автор

What a explanation. Hat's off to you.

iamyuvraj
Автор

Day 10 🔥.
only 30% of the people are able to be consistent for 10 days or more and if u are one of them, give urself a pat on the back, and good luck for the rest of the course, hopefully we will be together for this entire journey 💯

BurhanAijaz
Автор

Thankyou bhaiya for helping us learn this for free

ratnasanjay
Автор

Lecture 10 Done 💝💝👍👍👌👌👌🙌 waiting for the next Lecture 🤞🤞

anuraggulati
Автор

Yes, I submited this question before 1 day. But thank you for this video.

productivewind
Автор

Thanks Buddy for this wonderful explanation

vipulrohilla
Автор

thanks sir I was really messed with this question you helped me!

hashshamkhan
Автор

Aaj 6 se phle hi....you are making us more consistent!😎💯 Awesome content smjh aa rha hai ache se, ThankYou Fraz Bhaiya🙋‍♀️🤟thankyou so much.
WAITING FOR NEXT VIDEO

shagunchoudhary
join shbcf.ru