Company: Nebius early talent program_4april
Difficulty: medium
Two strings form a complementary pair if there exists some permutation of their concatenation that forms a palindrome. For example, the strings "abac" and "cab" form a complementary pair since their concatenation "abaccab" can be rearranged to form the palindrome "bcaaacb". Given an array of strings, find the number of complementary pairs that can be formed. Note that pairs (i, j) and (j, i) are considered the same. Example stringData = ["abc", "abcd", "bc", "adc"] The complementary pairs are: ("abc", "abcd") - concatenated to "abcabcd", which can be arranged as "abcdcba" ("abc", "bc") - concatenated to "abcbc", which can be arranged as "bcacb" ("abcd", "adc") - concatenated to "abcdadc", which can be arranged as "acdbdca" The answer is 3. Function Description Complete the function countComplementaryPairs in the editor with the following parameters: string stringData[n] : the strings to pair Returns long_int : the number of complementary pairs that can be formed Constraints 1 ≤ n &l