Company: Microsoft_18july
Difficulty: medium
Complementary Pairs Problem Description Two strings form a complementary pair if the characters of their concatenation can be rearranged into a palindrome. For example, "abac" and "cab" form a complementary pair: their concatenation "abaccab" can be rearranged into the palindrome "abcacba" . You are given n strings. Count how many complementary pairs they contain. Input Format The first line contains a single integer n , the number of strings. Each of the next n lines contains one string, made only of lowercase English letters. Output Format Print a single integer: the number of complementary pairs. Print 0 if there are none. Constraints 1 <= n <= 90000 (inferred - the source states 10^5 alongside a sum-of-lengths ceiling of 3 * 10^5; an input at those bounds is 400,007 bytes, twice what this judge accepts, so both bounds are lowered to fit.) 1 <= length of each string 1 <= sum of the lengths of all strings <= 100000 (inferred - sa