#C14959. Count Alphanumeric Characters
Count Alphanumeric Characters
Count Alphanumeric Characters
Given a string, count the occurrences of each alphanumeric character while ignoring case, and output the result in a dictionary format.
All letters should be converted to lowercase before counting. Non-alphanumeric characters are ignored. The output dictionary should list keys (characters) in lexicographical order using single quotes for keys.
Mathematically, for an input string (s), compute a dictionary (D) such that for every alphanumeric character (c) in (s), (D(\text{lower}(c))) is the number of times (c) occurs in (s).
inputFormat
A single string provided via standard input. The string may contain spaces, digits, special characters, and letters in mixed case.
outputFormat
A dictionary (as a string) showing each alphanumeric character (in lowercase) and its corresponding count. The keys must be sorted in lexicographical order and formatted like: {'key': value, ...}.## sample
aabbcc
{'a': 2, 'b': 2, 'c': 2}