Adding algorithm to calculate max occurrence of character