You are viewing a single comment's thread. Return to all comments →
This is how i solved this problem in java:
public static List<Integer> compareTriplets(List<Integer> a, List<Integer> b) { int score_a=0; int score_b=0; List<Integer> score = new ArrayList<>(); int size = Math.min(a.size(), b.size()); for(int i=0; i<size; i++){ if(a.get(i) > b.get(i)){ score_a += 1; }else if(a.get(i) < b.get(i)){ score_b += 1; } } score.add(score_a); score.add(score_b); return score; }
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 how i solved this problem in java: