Skip to content

Instantly share code, notes, and snippets.

@petermolnar-dev
Created December 22, 2016 14:40
Show Gist options
  • Save petermolnar-dev/92c564c17b90f45cbf2ed503a12a41fa to your computer and use it in GitHub Desktop.
Save petermolnar-dev/92c564c17b90f45cbf2ed503a12a41fa to your computer and use it in GitHub Desktop.
HackerRank - Objective-C read 2 parameters, and then a line
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]){
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
int n;
int k;
scanf("%i %i",&n,&k);
int a[n];
for(int a_i = 0; a_i < n; a_i++){
scanf("%d",&a[a_i]);
}
[pool drain];
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment