You are viewing a single comment's thread. Return to all comments →
Java
public static int sockMerchant(int n, List<Integer> ar) { Collections.sort(ar); int ctr = 0; for(int i = 0; i< ar.size()-1;i++){ if(ar.get(i) == ar.get(i+1)){ ctr++; i++; } } return ctr; }
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