You are viewing a single comment's thread. Return to all comments →
here is my c# code:
public static int gemstones(List<string> arr) { for(int i = 0; i < arr.Count(); i++) arr[i] = new string(arr[i].Distinct().ToArray()); List<char> gems = arr[0].Select(o => o).Distinct().ToList(); int counts = 0; arr.RemoveAt(0); foreach (char c in gems) counts += arr.Sum(o => o.Count(x => x == c)) == arr.Count() ? 1 : 0; return counts; }
Seems like cookies are disabled on this browser, please enable them to open this website
Gemstones
You are viewing a single comment's thread. Return to all comments →
here is my c# code: