find the min cut of palindrome (bug)