• + 0 comments

    C# solution:

    public static int gemstones(List<string> arr)
        {
            HashSet<char> common = new HashSet<char>(arr[0]);
            for (int i = 1; i < arr.Count; i++)
            {
                common.IntersectWith(arr[i]);
            }
            return common.Count;
        }