Compare the Triplets

  • + 0 comments
    public static List<Integer> compareTriplets(List<Integer> a, List<Integer> b) {
            int alicePoint = 0 ;
            int bobPoint = 0 ;
            for(int i = 0 ; i < 3 ; i++){
                if(a.get(i) > b.get(i)){
                    alicePoint++;
                }else if(a.get(i) < b.get(i) ){
                    bobPoint++;
                }
            }
            return Arrays.asList(alicePoint,bobPoint);
        }