# Given a string s, partition s such that every substring of the partition is a palindrome. # Return the minimum cuts needed for a palindrome partitioning of s. # For example, given s = "aab", # ...
return s_list[left+1:right+1] == s_list[left+1:right+1][::-1] or s_list[left:right] == s_list[left:right][::-1] ...