C++ program to find min and max occuring characters in a string