||Easy Java Solution||
\n\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        {\n     
\n\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        {\n            for(int j=i+1;j<words.length;j++)\n            {\n                count+=check(words[i],words[j]);\n            }\n        }\n        return count;\n    }\n\n    private int check(String a,String b)\n    {\n        HashSet<Character> aset=new HashSet();\n        for(char ch:a.toCharArray())\n            aset.add(ch);\n\n        HashSet<Character> bset=new HashSet();\n        for(char ch:b.toCharArray())\n            bset.add(ch);\n        return aset.equals(bset)?1:0;\n    }\n}\n```
['Java']