Compare the Triplets

  • + 0 comments

    java

    public static List compareTriplets(List a, List b) { int Alicescore =0; int Bobscore = 0;

        for(int i =0; i<3; i++)
        {
            if(a.get(i)>b.get(i))
            {
                Alicescore++;
            }
            else if(a.get(i)<b.get(i))
            {
                Bobscore++;
            }
        }
    
        List<Integer> earn = new ArrayList<>();
        earn.add(Alicescore);
        earn.add(Bobscore);
        return earn;
    
    }