← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Given a string s, you are allowed to add characters to the front of the string to make it a palindrome. Find the shortest palindrome by adding characters in front of the string.
Input:
s = "aacecaaa"
Output:
"aaacecaaa"
Input:
s = "abcd"
Output:
"dcbaabcd"
0 <= s.length <= 1000s consists of only lowercase English letters.