Loading...
Given a string, count the frequency of each character (case-insensitive, ignoring spaces) and return the result as a sorted dictionary.
Example:
Hello World
{'d': 1, 'e': 1, 'h': 1, 'l': 3, 'o': 2, 'r': 1, 'w': 1}Step 1: Lowercase and remove spaces "Hello World" → "helloworld"
Step 2: Count each character h:1, e:1, l:3, o:2, w:1, r:1, d:1
Step 3: Sort by key {'d': 1, 'e': 1, 'h': 1, 'l': 3, 'o': 2, 'r': 1, 'w': 1}