private static String findLongest(char[] chars, int left, int right) {
        int pLeft = left - 1;
        int pRight = right + 1;
        if (pLeft >= 0 && pRight < chars.length && chars[pLeft] == chars[pRight]) {
            return findLongest(chars, pLeft, pRight);
        }
        return String.valueOf(Arrays.copyOfRange(chars, left, pRight));
    }
Given a string S, find the longest palindromic substring in S.
You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.
java8/src/main/java/com/shekhargulati/leetcode/algorithms/Problem05.java