Compare the Triplets

    public static List<Integer> compareTriplets(List<Integer> a, List<Integer> b) {
    // Write your code here
        List<Integer> out = new ArrayList<Integer>(2);
        for (int i = 0; i < a.size(); i++) {
            if (a.get(i) > b.get(i))
                out.set(0, out.get(0) + 1);
            else if (a.get(i) < b.get(i))
                out.set(1, out.get(1) + 1);

        return out;

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s