Compare the Triplets

  • + 0 comments
    public static List<Integer> compareTriplets(List<Integer> a, List<Integer> b) {
            var alices = 0;
            var bobs = 0;
            for (int i = 0; i < 3; i++) {
                if(a.get(i) > b.get(i))
                    alices++;
                else if(a.get(i) < b.get(i))
                    bobs++;
            }
            return List.of(alices, bobs);
        }