I am trying to find a way to get the values of max/min freq of characters in a string
E.g. helpme
would have max freq = 2 and min freq = 1 (there are 2 e\'s and
You need to build a histogram:
size_t histogram[UCHAR_MAX] = { 0 }; // allocate and initialise histogram
for (size_t i = 0; s[i] != '\0'; ++i) // generate histogram for string s
{
histogram[(unsigned int)s[i]]++;
}
After this you can just do a linear scan through the histogram looking for the min and max letter frequencies.