You are viewing a single comment's thread. Return to all comments →
Or a BitSet if you wanna save some more memory :)
BitSet bitSet = new BitSet(COLOR_SIZE); for (int i = 0; i < size; i++) { int color = scanner.nextInt(); if (bitSet.get(color)) pairs++; bitSet.flip(color); }
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 →
Or a BitSet if you wanna save some more memory :)