Typically if I need a unique set I just use Set in the first place. A Set can't be populated with duplicate elements so I just insert whatever comes up and if it's duplicate no worries.
What is the use case for starting with an array full of possible duplicates and then converting to a set?
1
u/20EYES Jul 05 '21
Typically if I need a unique set I just use Set in the first place. A Set can't be populated with duplicate elements so I just insert whatever comes up and if it's duplicate no worries.
What is the use case for starting with an array full of possible duplicates and then converting to a set?
I'm probably overlooking something obvious lol.