Map each character appearing more than once to its count.
Example:
Input: str = "programming" Output: { r: 2, g: 2, m: 2 }