Given a string s, determine whether it can be split into exactly three non-empty palindromic substrings. Pattern focus: Palindrome partitioning. This is a boolean partitioning variant that relies on precomputed palindrome states.
s = input string
true if s can be partitioned into exactly three palindromic substrings
Example 1:
Input:
s = "abcbdd"
Output:
true
Explanation:
One valid split is a | bcb | dd.
Example 2:
Input:
s = "bcbddxy"
Output:
false
Explanation:
No split into exactly three palindromic substrings is possible.