Java || 1ms run:O(n) mem:O(1) || Boolean flags, No HashMap
\nclass Solution {\n    public int maximumNumberOfStringPairs(String[] words) {\n        boolean[] found = new boolean[26 * 26];\n        int pairCount = 0;\n  
```\nclass Solution {\n    public int maximumNumberOfStringPairs(String[] words) {\n        boolean[] found = new boolean[26 * 26];\n        int pairCount = 0;\n        for (String s : words) {\n            if (found[(s.charAt(1) - \'a\') * 26 + s.charAt(0) - \'a\'])  pairCount++;\n            found[(s.charAt(0) - \'a\') * 26 + s.charAt(1) - \'a\'] = true;\n        }\n        return pairCount;\n    }\n}\n```
[]