Sherlock and Anagrams

  • + 3 comments

    We can avoid one while loop inside check_anagram( ) function. As the lengths will be same. This will save few seconds of execution time.

    while(a[c] != '\0')

    {

    first[a[c]-'a']++;
    
    second[b[c]-'a']++;
    c++;
    

    }