two strings are said to be similar if they are composed of the same characters given an array of strings words of length n find the number of pairs of strings that are similar