public String longestPalindrome(String s) {
        if (s == null || s.length() == 0) return null;
        String longest = s.substring(0, 1);
        for (int i = 0; i < s.length(); i++) {
            String temp = helper(s, i, i);
            if (temp.length() > longest.length())
                longest = temp;
            temp = helper(s, i, i + 1);
            if (temp.length() > longest.length())
                longest = temp;
        }
        return longest;
    }