You are viewing a single comment's thread. Return to all comments →
for (int i = 0; i < n; i++) {
if (!colors.add(c[i])) { pairs++; colors.remove(c[i]); }
}
we dont even need contains, since add returns boolean.
Seems like cookies are disabled on this browser, please enable them to open this website
Equal
You are viewing a single comment's thread. Return to all comments →
for (int i = 0; i < n; i++) {
}
we dont even need contains, since add returns boolean.