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
Well that's... silly. So the fact that we are listing permutations is just a distraction? (I guess the length of B depends on the number of permutations but this can be stated differently (maybe not as concisely as this though))