palindrome-partitioning-ii in Java