Created
November 1, 2015 11:26
-
-
Save nbarnold01/04d13fdd93dfc6740492 to your computer and use it in GitHub Desktop.
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
#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