Shortest Palindrome: KMP-Based Solution
LeetCode 214 asks a deceptively simple question: given a string s, find the shortest palindrome you can create by adding characters only to the front. You can’t append to the end or modify…
LeetCode 214 asks a deceptively simple question: given a string s, find the shortest palindrome you can create by adding characters only to the front. You can’t append to the end or modify…