Created
November 27, 2010 10:01
-
-
Save fpillet/717759 to your computer and use it in GitHub Desktop.
@_Kolin: remove duplicates without using a set
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If you really want to do this without using a set, you can do it this way | |
NSUInteger count = [marray count]; | |
for (NSUInteger i = 0; i < (count-1); i++) { | |
[marray removeObjectIdenticalTo:[marray objectAtIndex:i] inRange:NSMakeRange(i+1, count-i-1); | |
count = [marray count]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment