For example, I have a string:
\"abbbbccd\"
b has the most occurrences. When using C++, the easiest way to handle this is inser
input.GroupBy(x => x).OrderByDescending(x => x.Count()).First().Key
Notes:
"aaaabbbb" only one of those will be returned (thanks xanatos for comment). If you need all of the elements with maximum count, use Albin's solution instead.