You are viewing a single comment's thread. Return to all comments →
Java
public static int sockMerchant(int n, List<Integer> ar) { int pairCount = 0; boolean[] odds = new boolean[101]; for (Integer now : ar) { if (odds[now]) { odds[now] = false; pairCount ++; } else { odds[now] = true; } } return pairCount; }
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 →
Java