My Solution || JAVA
Time Complexity: O(N^2)\nSpace Complexity: O(N)\n\n# Code\n\nclass Solution {\n    public int similarPairs(String[] words) {\n        \n       int out=0;\n     
Time Complexity: O(N^2)\nSpace Complexity: O(N)\n\n# Code\n```\nclass Solution {\n    public int similarPairs(String[] words) {\n        \n       int out=0;\n        \n       for(int i=0;i<words.length;i++){\n           TreeSet<Character> hs=new TreeSet<>();   \n           String s="";\n           for(char c:words[i].toCharArray())\n                hs.add(c);\n           for(char c:hs)\n               s+=String.valueOf(c);\n                \n           words[i]=s;\n       }\n       \n        for(int i=0;i<words.length-1;i++){\n       \n            for(int j=i+1;j<words.length;j++)\n               if(words[i].equals(words[j]))\n                    out++;\n            \n           \n        }\n        return out;\n    }\n}\n```
['Java']