You are viewing a single comment's thread. Return to all comments →
The code below works in all other test cases but show runtime error in test case#7,i don't know why.Please guide me.
int* breakingRecords(int score_count, int* score,int* result_count) { int max, min, up = 0, down = 0, itr; static int result[2]; max = min = score[0]; for(itr = 1; itr < score_count; itr++) { if(score[itr] > max) { max = score[itr]; up++; } else if(score[itr] < min) { min = score[itr]; down++; } } result[0] = up; result[1] = down; *result_count = 2; return result; }
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 →
The code below works in all other test cases but show runtime error in test case#7,i don't know why.Please guide me.