public int minCut(String s) {
        if(s == null) return -1;
        if(isPalindrome(s)) return 0;
        int min = Integer.MAX_VALUE;
        int temp;
        for(int i = 1; i<= s.length(); i++){
            String temp1 = s.substring(0,i);
            if(isPalindrome(temp1)){
//                if(isPalindrome(s.substring(i))) return 1;
                  min = min > (1 + (temp = minCut(s.substring(i)))) ?  temp : min ;
            }
        }
        return min;
    }