You are viewing a single comment's thread. Return to all comments →
// Javascript function sockMerchant(n, ar) { let pairCount = 0; let i = 0; ar.sort((a,b) => a - b); while(i < n - 1){ if(ar[i] == ar[i+1]){ pairCount++; i+=2; } else { i++; } } 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 →