Class Solution
java.lang.Object
g0201_0300.s0214_shortest_palindrome.Solution
214 - Shortest Palindrome.<p>Hard</p>
<p>You are given a string <code>s</code>. You can convert <code>s</code> to a palindrome by adding characters in front of it.</p>
<p>Return <em>the shortest palindrome you can find by performing this transformation</em>.</p>
<p><strong>Example 1:</strong></p>
<p><strong>Input:</strong> s = “aacecaaa”</p>
<p><strong>Output:</strong> “aaacecaaa”</p>
<p><strong>Example 2:</strong></p>
<p><strong>Input:</strong> s = “abcd”</p>
<p><strong>Output:</strong> “dcbabcd”</p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>0 <= s.length <= 5 * 10<sup>4</sup></code></li>
<li><code>s</code> consists of lowercase English letters only.</li>
</ul>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
shortestPalindrome
-