Count each character
easyStrings10 XP
Return a dictionary (JavaScript: an object) that maps each character of s to how many times it appears.
Examples
- Input: s = "banana"Output: {"b": 1, "a": 3, "n": 2}
- Input: s = ""Output: {}
Examples use JSON: true/false/null are True/False/None in Python.