Ctrl K

Every Letter Equally Often

Easy
Given a string text, return True if every letter that occurs in it occurs the **same** number of times, and False otherwise. Letters that do not appear in the string are ignored.
Example 1
text="xyzzyx" → True

Each of the letters x, y and z appears exactly twice.

Example 2
text="mmmoo" → False

m appears 3 times while o appears twice.

Example 3
text="q" → True

There is a single letter, so there is nothing to compare.

Constraints
  • 1 ≤ len(text) ≤ 1000
  • text consists of lowercase English letters
Have you seen this problem in a real interview?
Solved by0
Tried by0
Submissions0
Acceptance—
Topics
Similar problemsNote From Clipped Letters EasyFirst One-Off Letter EasyWords Heard Only Once EasyWords From Letter Tiles EasyBalloon Signs From Letters Easy
loading Python…
Input
text="xyzzyx"
Expected
True

Run checks the first 3 tests in your browser. Submit checks all 93 tests on the server, hidden ones included.