You are viewing a single comment's thread. Return to all comments →
That is almost exactly how I did it. haha Arrays seemed most logical to me.
static int[] solve(int a0, int a1, int a2, int b0, int b1, int b2){ // Complete this function int[] alice = {a0, a1, a2}; int[] bob = {b0, b1, b2}; int[] result = {0,0}; for(int i=0; i<3; i++){ if(alice[i] > bob[i]){ result[0]++; } else if(alice[i] < bob[i]) result[1]++; } return result;
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 →
That is almost exactly how I did it. haha Arrays seemed most logical to me.