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