Shortest Suffix to Form a Palindrome
Problem statement
Return the shortest string that can be appended to text so the result is a palindrome. If text is already a palindrome, return the empty string.
Function
shortestPalindromeSuffix(text: String) → StringExamples
Example 1
text = "banana"return = "b"Appending b creates bananab.
Constraints
0 <= text.length <= 2000.- The text contains lowercase English letters.