CodeOath
← All problems

Find Duplicate Character Positions

Medium
stringshash-table

Map each character appearing more than once to the list of index positions where it occurs.

Example:

Input: str = "programming"
Output: { r: [1, 4], g: [3, 10], m: [6, 7] }