You are given a string 'str' of length 'n'.
Find the minimum number of partitions in the string so that no partition is empty and every partitioned substring is a palindrome.
Input: 'str' = "aaccb"
Explanation: We can make a valid partition like aa | cc | b.
Input format :
The first line contains the string 'str', the string to be partitioned.
Output Format :
Print the minimum number of cuts to be done so that each partitioned substring is a palindrome.
You do not need to print anything; it has already been taken care of. Just implement the given function.