Palindrome Partitioning Leetcode Solution