Tap here to switch tabs
Problem
Submissions

Problem: Longest Chunked Palindrome Decomposition

med
30 min
Try to solve the Longest Chunked Palindrome Decomposition problem.

Statement

Given a string text, partition it into kk non empty substrings (a1,a2,…,ak)(a_1, a_2, \dots, a_k) such that concatenating them sequentially forms text, and ai=ak−i+1a_i = a_{k - i + 1} holds for each ii from 11 to kk.

Return the maximum possible value of kk.

Constraints:

  • 1≤1 \le text.length ≤1000\le 1000

  • text consists only of lowercase English characters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Longest Chunked Palindrome Decomposition

med
30 min
Try to solve the Longest Chunked Palindrome Decomposition problem.

Statement

Given a string text, partition it into kk non empty substrings (a1,a2,…,ak)(a_1, a_2, \dots, a_k) such that concatenating them sequentially forms text, and ai=ak−i+1a_i = a_{k - i + 1} holds for each ii from 11 to kk.

Return the maximum possible value of kk.

Constraints:

  • 1≤1 \le text.length ≤1000\le 1000

  • text consists only of lowercase English characters.