Palindrome Partition
JJ has a binary string $S$ of length $2 \cdot N$. He wants to partition it into $M$ substrings such that: - $1 \le M \le 2 \cdot N$ - Each $S_i$ belongs to exactly one partition - None of the partitioned substrings is a palindrome For example: One of the valid partitions of $10010011$ is $\underline{100}\ \underline{10}\ \underline{011}$. Can you find any partition satisfying the above condition
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start