You are viewing a single comment's thread. Return to all comments →
C# Code
public static int sockMerchant(int n, List<int> ar) { int pairCount = 0; var groupList = ar.Order() .GroupBy(e => e) .Select(e => new { SockId = e.Key, Count = e.Count() }) .ToList(); foreach(var sockGroup in groupList) { pairCount += sockGroup.Count / 2; } 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 →
C# Code