Sherlock and Anagrams

  • + 0 comments

    Phrase "unordered anagrammatic pair" appears only in "Ouput Format" section, which you can (most of the time) just skip assuming you implement the provided code template. The problem definition in the first paragraph is normative.

    "Unordered pair" just means that pair is expressed as {a, b}, not (a, b), i. e. the order does not matter. (1, 2) and (2, 1) are two different pairs (size of set { (1, 2), (2, 1) } is 2), while {1, 2} and {2, 1} are just two ways to write the same pair (size of set { {1, 2}, {2, 1} } is 1.