java.lang.Object
g1701_1800.s1745_palindrome_partitioning_iv.Solution

public class Solution extends Object
1745 - Palindrome Partitioning IV.<p>Hard</p> <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><strong>Example 1:</strong></p> <p><strong>Input:</strong> s = &ldquo;abcbdd&rdquo;</p> <p><strong>Output:</strong> true</p> <p><strong>Explanation:</strong> &ldquo;abcbdd&rdquo; = &ldquo;a&rdquo; + &ldquo;bcb&rdquo; + &ldquo;dd&rdquo;, and all three substrings are palindromes.</p> <p><strong>Example 2:</strong></p> <p><strong>Input:</strong> s = &ldquo;bcbddxy&rdquo;</p> <p><strong>Output:</strong> false</p> <p><strong>Explanation:</strong> s cannot be split into 3 palindromes.</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>
  • Constructor Details

    • Solution

      public Solution()
  • Method Details

    • checkPartitioning

      public boolean checkPartitioning(String s)