How to split a string into as few palindromes as possible?

Viewed 10262

This is an interview question: "You're given a string, and you want to split it into as few strings as possible such that each string is a palindrome". (I guess a one char string is considered a palindrome, i.e. "abc" is split into "a", "b", "c".)

How would you answer it?

5 Answers
Related