public String strStr(String haystack, String needle) {
        if (haystack == null || haystack.length() == 0) {
            if (needle == null || needle.length() == 0) {
                return haystack;
            }
            return null;
        }
        char[] s = haystack.toCharArray(), p = needle.toCharArray();
        int[] next = makeSunday(p);
        for (int i = 0; i <= s.length - p.length; ) {
            int l = p.length - 1;
            while (l >= 0 && s[i + l] == p[l]) {
                l --;
            }
            if (l < 0) {
                return String.valueOf(s, i, s.length - i);
            }
            if (i >= s.length - p.length) {
                break;
            }
            i += next[s[i + p.length] - 'a'];
        }
        return null;
    }