using System;
using System.Collections.Generic;
class Program
{
static void Main()
{
string str = "hell";
Dictionary<char, int> count = new Dictionary<char, int>();
for (int i = 0; i < str.Length; i++)
{
char ch = str[i];
if (count.ContainsKey(ch))
{
count[ch]++;
}
else
{
count[ch] = 1;
}
}
foreach (var pair in count)
{
Console.WriteLine($"{pair.Key}, {pair.Value}");
}
}
}
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)