Java Solution || HashSet
\n# Code\n\nclass Solution {\n    public int similarPairs(String[] words) {\n        int count = 0;\n        for(int i=0; i<words.length-1; i++){\n            f
\n# Code\n```\nclass Solution {\n    public int similarPairs(String[] words) {\n        int count = 0;\n        for(int i=0; i<words.length-1; i++){\n            for(int j=i+1; j<words.length; j++){\n                count += check(words[i], words[j]);\n            }\n        }\n        return count;\n    }\n    private int check(String s, String t){\n        Set sset = new HashSet();\n        for(char c: s.toCharArray())    sset.add(c);\n        Set tset = new HashSet();\n        for(char c: t.toCharArray())    tset.add(c);\n        return sset.equals(tset) ? 1 : 0;\n    }\n}\n```
['Java']