mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
29 lines
1.0 KiB
HTML
29 lines
1.0 KiB
HTML
<p>Given a string <code>s</code>, return <code>true</code> <em>if it is possible to split the string</em> <code>s</code> <em>into three <strong>non-empty</strong> palindromic substrings. Otherwise, return </em><code>false</code>.</p>
|
||
|
||
<p>A string is said to be palindrome if it the same string when reversed.</p>
|
||
|
||
<p> </p>
|
||
<p><strong class="example">Example 1:</strong></p>
|
||
|
||
<pre>
|
||
<strong>Input:</strong> s = "abcbdd"
|
||
<strong>Output:</strong> true
|
||
<strong>Explanation: </strong>"abcbdd" = "a" + "bcb" + "dd", and all three substrings are palindromes.
|
||
</pre>
|
||
|
||
<p><strong class="example">Example 2:</strong></p>
|
||
|
||
<pre>
|
||
<strong>Input:</strong> s = "bcbddxy"
|
||
<strong>Output:</strong> false
|
||
<strong>Explanation: </strong>s cannot be split into 3 palindromes.
|
||
</pre>
|
||
|
||
<p> </p>
|
||
<p><strong>Constraints:</strong></p>
|
||
|
||
<ul>
|
||
<li><code>3 <= s.length <= 2000</code></li>
|
||
<li><code>s</code> consists only of lowercase English letters.</li>
|
||
</ul>
|