You are viewing a single comment's thread. Return to all comments →
As a Linq lover, I would just do this
public static int sockMerchant(int n, List<int> ar) { var ret = ar.GroupBy(x => x).Select(x => new { item = x.Key, freq = x.Count() / 2 }).Sum(x => x.freq); return ret; }`
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 →
As a Linq lover, I would just do this