Skip to content

Files

Latest commit

0569c9f · Sep 19, 2024

History

History
67 lines (44 loc) · 1.14 KB

1745-palindrome-partitioning-iv.adoc

File metadata and controls

67 lines (44 loc) · 1.14 KB

1745. Palindrome Partitioning IV

{leetcode}/problems/palindrome-partitioning-iv/[LeetCode - 1745. Palindrome Partitioning IV ^]

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 the same string when reversed.

Example 1:

Input: s = "abcbdd"
Output: true
*Explanation: *"abcbdd" = "a" + "bcb" + "dd", and all three substrings are palindromes.

Example 2:

Input: s = "bcbddxy"
Output: false
*Explanation: *s cannot be split into 3 palindromes.

Constraints:

  • 3 ⇐ s.length ⇐ 2000

  • s​​​​​​ consists only of lowercase English letters.

思路分析

一刷
link:{sourcedir}/_1745_PalindromePartitioningIv.java[role=include]

参考资料