Ctrl K

Shuffle Into a Palindrome

Easy
You have a set of letters given as the string letters. You may rearrange them in any order, but you cannot add or drop any. Return True if all of these letters can be arranged into a palindrome (a string that reads the same left to right and right to left), and False otherwise.
Example 1
letters="tatoo" → True

These letters can form "otato", which reads the same both ways.

Example 2
letters="lamp" → False

All four letters are different, so they cannot be arranged symmetrically.

Example 3
letters="xxyy" → True
Constraints
  • 1 ≤ len(letters) ≤ 5000
  • letters consists of lowercase English letters
Have you seen this problem in a real interview?
Solved by0
Tried by0
Submissions0
Acceptance—
Topics
Similar problemsThe Sneaked-In Letter EasyWords From Working Keys EasyBoth Cases Stretch EasyFirst Letter Seen Again EasyPairs With the Same Letter Set Easy
loading Python…
Input
letters="tatoo"
Expected
True

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