214. Shortest Palindrome
Description
Given a string s, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you can find by performing this transformation.
Constraints
Approach
Links
GeeksforGeeks
YouTube
Examples
Input: "aacecaaa"
Output: "aaacecaaa"
Input: "abcd"
Output: "dcbabcd"
Solutions
Follow up
Last updated
Was this helpful?