⬆️✅🔥 100% | 0ms | faster | simple | easy
upvote\n\n# Complexity\n- Time complexity:O(n*n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity:O(n)\n Add your space complexity here, e.g. O
# upvote\n\n# Complexity\n- Time complexity:O(n*n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int similarPairs(String[] W) {\n        int c=0,L=W.length;\n        for(int i=0;i<L;i++){\n            int A[]=feed(W[i]);\n            for(int j=i+1;j<L;j++){\n                if(Arrays.equals(A,feed(W[j])))c++;\n            }\n        }\n        return c;\n    }\n    private int[] feed(String d){\n    int[] st=new int[26];\n        for(char v:d.toCharArray()) st[v-\'a\']=1;\n        return st;\n    }\n}\n```
['Python', 'C++', 'Java', 'Python3']