You are viewing a single comment's thread. Return to all comments →
C code solution
int* compareTriplets(int a_count, int* a, int b_count, int* b, int* result_count) { *result_count = 2; int ans; ans = (int)calloc(2,sizeof(int));
int min = (a_count<b_count)?a_count:b_count; for(int i=0; i< min; i++) { if(a[i] > b[i]) { ans[0]++; } else if(b[i]>a[i]) { ans[1]++; } } return ans;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Compare the Triplets
You are viewing a single comment's thread. Return to all comments →
C code solution
int* compareTriplets(int a_count, int* a, int b_count, int* b, int* result_count) { *result_count = 2; int ans; ans = (int)calloc(2,sizeof(int));
}