I'm currently enumerating through NSMutableArray
(or NSMutableSet
) elements to find duplicates and remove them.
For example, if array/set has values [@"a", @"b", @"b", @"c"]
, the end result should be [@"a", @"b", @"c"]
.
Since I'm comparing NSStrings
, I'm using isEqualTo:
method to check if strings are equal.
Is there a more efficient way to do remove duplicate entries than to loop through all of them and check if duplicate exists?