Write FirstUnique. For every non-empty input line, count its letters (ignore case, digits, spaces and punctuation) in a LinkedHashMap<Character, Integer> and print the first letter that occurs exactly once, the most frequent letter (the earliest one on a tie) and the number of distinct letters.
For the input
swiss cheese
level
Data Structures
the program prints
swiss cheese
first unique letter: w
most frequent: s x4
distinct letters: 6
level
first unique letter: v
most frequent: l x2
distinct letters: 3
Data Structures
first unique letter: d
most frequent: t x3
distinct letters: 8
What would go wrong with a plain HashMap?