Count each character in a string. Print each character and its count, sorted by character. Ignore spaces in the count.
Input: A single string
Output: Each unique character followed by its count, one per line, sorted alphabetically
Example:
- Input:
"hello" - Output:
e 1,h 1,l 2,o 1
Think about which data structure naturally tracks counts, and how to iterate through sorted keys.