You are viewing a single comment's thread. Return to all comments →
Solution in Java - feel free to review my code -
int[] tripletsResult = new int[2];
for (int i = 0; i < a.size(); i++) { if (a.get(i) > b.get(i)) { tripletsResult[0] = tripletsResult[0] + 1; } else if (b.get(i) > a.get(i)) { tripletsResult[1] = tripletsResult[1] + 1; } } List<Integer> tripletsResult1 = new ArrayList<>(List.of(tripletsResult[0], tripletsResult[1])); return tripletsResult1; List<Integer> tripletsResult1 = new ArrayList<>(List.of(tripletsResult[0], tripletsResult[1])); return tripletsResult1;
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 →
Solution in Java - feel free to review my code -
int[] tripletsResult = new int[2];