We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Sales by Match
Sales by Match
Sort by
recency
|
6060 Discussions
|
Please Login in order to post a comment
Initial solution in JS. I will post an optimized solution later.
Easy to read code, concise and efficient
def sockMerchant(n, ar): Sum = 0 for i in list(set(ar)): Sum += ar.count(i)//2 return Sum `
Java using Collections frequency utility:
This is my solution in JS: