Java Easy to Understand Solution Using HashSet
Code\n\nclass Solution {\n    public int maximumNumberOfStringPairs(String[] words) {\n        int count = 0;\n\t\tSet<String> ans = new HashSet<>();\n\t\tfor (
# Code\n```\nclass Solution {\n    public int maximumNumberOfStringPairs(String[] words) {\n        int count = 0;\n\t\tSet<String> ans = new HashSet<>();\n\t\tfor (String str : words) {\n\t\t\tchar ch[] = str.toCharArray();\n\t\t\tArrays.sort(ch); // Sort the Characters of each string.\n\t\t\tif (!ans.add(String.valueOf(ch))) // If the duplicate exists while adding in the set, increase the count.\n\t\t\t\tcount++;\n\t\t}\n\t\treturn count;\n    }\n}\n```\n\nPlease upvote, if you like this. Thanks.
['Java']