121: Palindrome partitioning

Given a string, return the minimum number of partitions required to split given string into palindromes

 

Example 1

Input:   aba 

Output:  0

Explanation: aba it's a palindrome

Example 2

Input:   aacc 

Output:  1

Explanation: aa and cc

Difficulty:Hard
Topic:Dynamic programming
Problem #:121