Stax, 13 bytes
绬►Ö∞j∞:Æ╘τδ
Run test cases (It takes about 10 seconds on my current machine)
This is the corresponding ascii representation of the same program.
:e{cr=fw|Nc$cr=!
It's not quite pure brute-force, but it's just as small as the brute-force implementation I wrote. That one crashed my browser after about 10 minutes. Anyway, here's how it works.
:e Get all contiguous substrings
{cr=f Keep only those that are palindromes
w Run the rest of the program repeatedly while a truth value is produced.
|N Get the next permutation.
c$ Copy and flatten the permutation.
cr=! Test if it's palindrome. If not, repeat.
The last permutation produced will be implicitly printed.
recursive
- 10.5k
- 21
- 36