public String longestPalindrome(String s) {
        if (s == null || s.length() == 0)
            return s;
        String max = String.valueOf(s.charAt(0));
        char[] a = s.toCharArray();
        for (int i = 0; i < s.length(); i++) {
            int[] p1 = pal(a, i, i);
            if (p1[1] - p1[0] > max.length()) {
                max = s.substring(p1[0], p1[1]);
            }
            p1 = pal(a, i, i + 1);
            if (p1[1] - p1[0] > max.length()) {
                max = s.substring(p1[0], p1[1]);
            }

        }
        return max;
    }
Why Did you create this class? what does it do?
src/problems/medium/LongestPalindromicSubstring.java