Max COUNT among Vovels
string vovels = "aeiou";
string quest = "eeaaaaiiiieeeeuuuuuuu";
Dictionary<char, int> keyValuePairs = new Dictionary<char, int>();
foreach (char c in vovels)
{
int count = 0;
foreach (char q in quest)
{
if (c == q)
{
count++;
if (keyValuePairs.ContainsKey(c))
{
keyValuePairs[c]++;
}
else
{
keyValuePairs.Add(c, count);
}
}
}
}
int max = 0;
char ch = 'a';
foreach (char c in vovels)
{
int tmp = 0;
foreach (var dict in keyValuePairs)
{
if (dict.Key == c)
{
tmp++;
}
}
if (tmp > max)
{
ch = c;
}
}
Console.WriteLine(ch);