code for Palindrome Partitioning