C++ · problem solving

Hacker Rank “Sherlock and Anagrams”

  Given a string , find the number of "unordered anagrammatic pairs" of substrings. Input Format First line contains , the number of testcases. Each testcase consists of string in one line. Output Format For each testcase, print the required answer in one line. Sample Input#00 2 abba abcd Sample Output#00 4 0 Sample Input#01… Continue reading Hacker Rank “Sherlock and Anagrams”