BackhardStrings

Symmetric Substring Division Solution

Problem Statement

Given a string, determine the minimum number of divisions required to partition it into symmetric substrings. A symmetric substring is a palindrome, reading the same backward as forward.

Example 1
Input
abccba
Output
1
Example 2
Input
abcdedcba
Output
1
Example 3
Input
abba
Output
1
Example 4
Input
abc
Output
3

Constraints

  • 1 <= length of string <= 1000
  • string consists only of lowercase letters
  • the string may or may not be a palindrome
Live Compiler
Loading...
Test Cases & Output
🔒 Sign up to run your code

🚀 Practice this problem

Run code, get AI hints & track streak

Sign Up Free