You are viewing a single comment's thread. Return to all comments →
'''
Set<Integer> colors = new HashSet<>(); int pairs = 0; for (int i = 0; i < n; i++) { if (!colors.contains(c[i])) { colors.add(c[i]); } else { pairs++; colors.remove(c[i]); } } System.out.println(pairs);
Seems like cookies are disabled on this browser, please enable them to open this website
Sales by Match
You are viewing a single comment's thread. Return to all comments →
'''
'''