strings-char-max-count Get the max occurrence of a character in a string , if there is a tight then give preference to the first letter you got Using Map & 2 loop