<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>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> s = &quot;abcbdd&quot;
<strong>Output:</strong> true
<strong>Explanation: </strong>&quot;abcbdd&quot; = &quot;a&quot; + &quot;bcb&quot; + &quot;dd&quot;, and all three substrings are palindromes.
</pre>

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong> s = &quot;bcbddxy&quot;
<strong>Output:</strong> false
<strong>Explanation: </strong>s cannot be split into 3 palindromes.
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>3 &lt;= s.length &lt;= 2000</code></li>
	<li><code>s</code>​​​​​​ consists only of lowercase English letters.</li>
</ul>

class Solution:
    def checkPartitioning(self, s: str) -> bool:
        
        prefix_palindrome_end_indices: List[int] = list()
        suffix_palindrome_start_indices: List[int] = list()

        for substring_prefix_end_index in range(len(s)):
            if Solution.is_palindrome(string=s, start_index=0, end_index=substring_prefix_end_index):
                prefix_palindrome_end_indices.append(substring_prefix_end_index)

        for suffix_palindrome_start_index in range(len(s)-1, -1, -1):
            if Solution.is_palindrome(string=s, start_index=suffix_palindrome_start_index, end_index=len(s)-1):
                suffix_palindrome_start_indices.append(suffix_palindrome_start_index)
        
        # print(f'PrefixEndIndices -> {prefix_palindrome_end_indices} SuffixStartIndices -> {suffix_palindrome_start_indices}')

        for prefix_palindrome_end_index in prefix_palindrome_end_indices:
            for suffix_palindrome_start_index in suffix_palindrome_start_indices:
                if suffix_palindrome_start_index + 1 > prefix_palindrome_end_index - 1:
                    middle_str_start_index: int = prefix_palindrome_end_index + 1
                    middle_str_end_index: int = suffix_palindrome_start_index - 1
                    if Solution.is_palindrome(string=s, start_index=middle_str_start_index, end_index=middle_str_end_index):
                        return True
                else:
                    break
        return False

    @staticmethod
    def is_palindrome(string: str, start_index: int, end_index: int) -> bool:
        if start_index > end_index:
            return False

        return string[start_index: end_index+1] == string[start_index: end_index+1][::-1]

        curr_start_index: int = start_index
        curr_end_index: int = end_index
        
        palindrome_flag: bool = True

        while curr_start_index <= curr_end_index and string[curr_start_index] == string[curr_end_index]:
            curr_start_index += 1
            curr_end_index -= 1

        return curr_start_index > curr_end_index

1358