using System.Collections.Generic;
public static void Main()
Dictionary<char, int> occurances = new Dictionary<char, int>();
List<char> elements = new List<char>{'A', 'B','C','C','C','A','B', 'C', 'C'};
foreach(char element in elements)
if(occurances.TryGetValue(element, out result))
occurances[element] = result + 1;
occurances.Add(element, 1);
foreach(KeyValuePair<char, int> kv in occurances)
Console.WriteLine("Key: "+ kv.Key + " Value: "+kv.Value);