letters (a string of lowercase English letters) and a number count. Can you distribute **all** the letters among exactly count non-empty strings so that each string is a palindrome, reading the same forwards and backwards?
The order of the letters in letters does not matter: you may rearrange them freely. Return True if this is possible, otherwise False.letters="racecar", count=3 → True
For example rcr, aea and c: every letter is used and all three are palindromes.
letters="abcde", count=3 → False
All five letters appear once, and a palindrome can hold at most one unpaired letter. Three palindromes are not enough for five unpaired letters.
letters="zz", count=3 → False
Two letters cannot make three non-empty strings.
letters consists of lowercase English letterscount ≤ 10⁵letters="racecar", count=3
True
Run checks the first 3 tests in your browser. Submit checks all 102 tests on the server, hidden ones included.