Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Keep a map of each name and the smallest valid integer that can be appended as a suffix to it.
If the name is not present in the map, you can use it without adding any suffixes.
If the name is present in the map, append the smallest proper suffix, and add the new name to the map.