You are given a string text.
You need to break it into several non-empty pieces such that:
All pieces concatenated together form the original string.
The first piece must be equal to the last piece,
the second piece equals the second last, and so on.
Your goal is to maximize the number of pieces formed this way.
Return the maximum number of such symmetric chunks.
Input: text = "abcxyzabc"
Output: 3
Explanation:
Split → ("abc")("xyz")("abc")
Input: text = "aaaa"
Output: 4
Explanation:
Split → ("a")("a")("a")("a")
Input: text = "level"
Output: 1
Explanation:
No symmetric chunking is possible except the whole string.
Accepted:
Submission: