Find the duplicated letters in the string and count how much time it gets duplicated
Sigiloso
givenString = "agegecdeav"; //Expected out put "a2g2e3" resalt = ""; var xvd = from v in givenString group v by v into y select y; foreach (var x in xvd) { if (x.Count() > 1) { result += x.Key + x.Count().ToString(); } } Console.WriteLine($" { result} ");