You are viewing a single comment's thread. Return to all comments →
Here is my solution using C .
int main() {
int a_count = 0, b_count = 0; int a[3], b[3] , result_count[2]; int i; i = 0; scanf("%d %d %d\n", &a[0], &a[1], &a[2]); scanf("%d %d %d", &b[0], &b[1], &b[2]); while (a[i] && b[i]) { if (a[i] > b[i]) a_count = a_count + 1; else if (a[i] < b[i]) b_count = b_count + 1; i++; } result_count[0] = a_count; result_count[1] = b_count; printf("[%d , %d]", result_count[0] , result_count[1]); return 0;
}
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 →
Here is my solution using C .
include
int main() {
}