You are viewing a single comment's thread. Return to all comments →
this is wrong, because solve method need return int [] value
why my code wrong? but then output is right
static int[] solve(int[] a, int[] b) { int pointAlice = 0; int pointBob = 0; for(int i=0; i < ((a.length<=b.length)?a.length:b.length);i++){ pointAlice += ((a[i]>b[i])?1:0); pointBob += ((a[i]>b[i])?0:1); } return new int[] {pointAlice,pointBob}; }
static int[] solve(int[] a, int[] b) {
int pointAlice = 0; int pointBob = 0; for(int i=0; i < ((a.length<=b.length)?a.length:b.length);i++){ pointAlice += ((a[i]>b[i])?1:0); pointBob += ((a[i]>b[i])?0:1); } return new int[] {pointAlice,pointBob};
}
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 →
this is wrong, because solve method need return int [] value
why my code wrong? but then output is right