letters. Rearranging them gives new words of the same length.
Return every distinct palindrome you can get by rearranging all the letters of letters (each letter used as many times as it appears). If no palindrome is possible, return an empty list. The answer may be in any order.letters="ttoo" → ['otto', 'toot']
Two t's and two o's make exactly two palindromes.
letters="kayak" → ['akyka', 'kayak']
The single "y" goes in the middle; the sides are "ka" or "ak".
letters="dog" → []
Three different letters cannot form a palindrome.
letters consists of lowercase English lettersletters="ttoo"
['otto', 'toot']
Run checks the first 3 tests in your browser. Submit checks all 82 tests on the server, hidden ones included.