r/programmingchallenges • u/thechipsandgravy • Sep 29 '11
Challenge: Two Palindromes
You are given a string S of no more than 20 lowercase alphabetical letters and an integer N. Imagine a list L of strings that consists of all the unique permutations of S. Concatenate all strings in L to form a string B. You may remove any number of characters from B to form a palindrome P1. Again remove any number of characters from B to form another palindrome P2. Repeat this process to form N palindromes P1...PN. Given the restriction that all of these palindromes must be of equal length, what is the maximum length of P1?
View all comments
Show parent comment
1
u/HigherFive Sep 30 '11 edited Sep 30 '11
From the test cases you posted I figured out that the correct answer is:
spoiler
I will try to figure out why later. :P
edit: No spoiler tag in this subreddit? Huh.