Profile the Character Mix

Intermediate

A text-analysis tool profiles how often each character appears in a token. Build the frequency map it displays.

Implement `solve(String text)` (no spaces) to return a Map<String, Integer> of each character to its count.

Examples

Input"mississippi"
Output{m=1, i=4, s=4, p=2}
Input"aa"
Output{a=2}
Hints
  • Loop characters with substring(i, i+1); increment per character.
Anonymous Apex

Your code runs in a secure sandbox against multiple hidden test cases. The problem is solved only when every test passes. Each run is isolated and any data changes are rolled back automatically.