Java | Easy to Understand
Code\n\nclass Solution {\n    public int similarPairs(String[] words) {\n        HashMap<String, Integer> map = new HashMap();\n        for(String str:words){\n
# Code\n```\nclass Solution {\n    public int similarPairs(String[] words) {\n        HashMap<String, Integer> map = new HashMap();\n        for(String str:words){\n            Set<Character> set = new HashSet();\n            for(int i = 0; i < str.length(); i++){\n                char ch = str.charAt(i);\n                set.add(ch);\n            }\n            String s = set.toString();\n            map.putIfAbsent(s,0);\n            map.put(s,map.get(s)+1);\n        }\n        int ans = 0;\n        for(String s:map.keySet()){\n            int items = map.get(s);\n            ans += (items*(items-1))/2;\n        }\n        return ans;\n    }\n}\n```
['Java']