348. Palindrome Partitioning IV

HardDynamic Programming

Given a string `s`, return `true` if it is possible to split the string `s` into **three non-empty** palindromic substrings. Otherwise, return `false`. A string is said to be palindrome if it is the same string when read from the front and the back.

Examples

Input: abcbdd

Output: true

Explanation: "a" | "bcb" | "dd" are three non-empty palindromic substrings.

Constraints

  • 3 <= s.length <= 2000
  • s consists only of lowercase English letters.
Loading...

Run checks all cases above. Submit evaluates all test cases.