We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
staticint[]solve(inta0,inta1,inta2,intb0,intb1,intb2){// Complete this functionint[]solve={0,0};int[]a={a0,a1,a2};int[]b={b0,b1,b2};for(inti=0;i<3;i++){if(a[i]>b[i])solve[0]+=1;if(a[i]<b[i])solve[1]+=1;}returnsolve;}
This code worked for me in C#... Threw the variables into new arrays, guess would be easier just to toss it arrays? then compared each in the for loop.
Cookie support is required to access HackerRank
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 code worked for me in C#... Threw the variables into new arrays, guess would be easier just to toss it arrays? then compared each in the for loop.