You are viewing a single comment's thread. Return to all comments →
java
public static List<Integer> compareTriplets(List<Integer> a, List<Integer> b) { ArrayList<Integer> ans = new ArrayList<>(); int aCount=0; int bCount=0; for(int i=0;i<3;i++){ if(a.get(i)>b.get(i)){ aCount++; } else if(a.get(i)<b.get(i)){ bCount++; } else{ continue; } } ans.add(aCount); ans.add(bCount); return ans; } }
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 →
java