optimized [palindrome partitioning]