Java Program to find maximum and minimum occurring character in a string.
In this program, we need to count each character present in the string and find out the maximum and minimum occurring character.
Grass is greener on the other side
In above example, character 'a' is occurred only once in the string. So, it is minimum occurring character and is highlighted by red. Character e has occurred maximum number of times in the entire string i.e. 6 times. Hence, it is the maximum occurring character and is highlighted by green.
Minimum occurring character: a Maximum occurring character: e