Equal Character Frequency (Remove-One Variant)

Asked at Bloomberg · Coding Questions · Difficulty: Medium · Last asked Jan 21, 2026

Decide whether all characters in a string occur with the same frequency, then a follow-up: whether removing exactly one character can produce a string in which all surviving characters have equal frequency. The interviewer escalates by demanding better-than-naive time and space.

Loading the problem…