You are viewing a single comment's thread. Return to all comments →
int* breakingRecords(int scores_count, int* scores, int* result_count) { int* a=(int*)malloc(2*sizeof(int)); int highcount=0,lowcount=0,max,min; max=scores[0]; min=scores[0]; for(int i=1;i<scores_count;i++) { if(scores[i]>max) {max=scores[i]; highcount+=1;} if(scores[i]<min) {min=scores[i]; lowcount+=1;} } a[0]=highcount; a[1]=lowcount; *result_count=2; return a; }
Seems like cookies are disabled on this browser, please enable them to open this website
Breaking the Records
You are viewing a single comment's thread. Return to all comments →