Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
// insert code here...
NSCountedSet *numbers = [[NSCountedSet alloc]initWithCapacity:100];
int count = 0;
scanf("%d", &count);
for (int i = 0; i< count; i++) {
int num = 0;
scanf("%d", &num);
[numbers addObject:[NSNumber numberWithInt:num]];
}
[numbers enumerateObjectsUsingBlock:^(NSNumber *obj, BOOL * stop) {
if ([numbers countForObject:obj] ==1){
printf("%d",obj.intValue);
*stop = YES;
}
}];
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.