Archive / 2020 / Selection Test
Secret Palindrome
Michel has captured a ciphertext string. Next, he wants to figure out the secret to unlock a door. The secret is the lexicographically smallest, longest palindrome that can be made by rearranging a subset of characters from the ciphertext string.
Palindrome:- A palindrome is a sequence of characters that reads the same backwards and forward.
Eg:- racecar
Input Format
One line containing a ciphertext string of lowercase alphabetical letters(no other characters).
Output Format
Output a single line containing the secret.
Constraints
- 5 \(\leq\) length of ciphertext \(\leq\) 50,000
Limits
- Time Limit: 1s
- Memory Limit: 256MB
Sample Input 0
ascaaarataxsda
Sample Output 0
aaasasaaa
Open on HackerRank ↗ · Markdown source · Back to the archive