Skip to content

Instantly share code, notes, and snippets.

@nbarnold01
Created November 1, 2015 11:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nbarnold01/04d13fdd93dfc6740492 to your computer and use it in GitHub Desktop.
Save nbarnold01/04d13fdd93dfc6740492 to your computer and use it in GitHub Desktop.
#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