Search
⌘K

Leetcode 214. Shortest Palindrome

Given a string s, return the shortest palindrome obtainable by adding characters only to the front. This is equivalent to finding the longest palindromic prefix and prepending the reverse of the remaining suffix, typically solved in linear/near-linear time using KMP, Manacher, or rolling-hash techniques.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Your account is free and you can post anonymously if you choose.