public static void main(String args[]){
        char str1[] = "aaabccde".toCharArray();
        char str2[] = "tbcdaacaaecbd".toCharArray();
        AnagramOfFirstAsSubstring ana = new AnagramOfFirstAsSubstring();
        System.out.println(ana.isSubString(str1, str2));
    }
http://www.careercup.com/question?id=5389078581215232
Given two strings tells if anagram of first is substring of another
Keep map of characters in array1 and keep checking if array2 has these characters.
main string : a b a c a b b and looking for a a b b c when 3rd a is encountered
we move index to second a and start from there.

Another idea is to keep a sorted linklist of string in comparison. Whenever a new character
is to be added remove last character from linklist and add this new one.
src/com/interview/string/AnagramOfFirstAsSubstring.java