Shortest Palindrome
hard
1. You are given string(str). 2. You can convert the given string to a palindrome by adding some characters in front of it. 3. You have to find the shortest palindromic string formed after performing the above-mentioned transformation.
Constraints
1 <= length of the string <= 10^4
Format
Input
A string
Output
A string
Example
Sample Input
coding
Sample Output
gnidocoding
Question Video