Java || O(N) runtime, O(N) space || Scalable solution using StringBuilder.reverse()
O(N) runtime due to iteration through words.\nO(N) space due to HashSet wordSet that may go up to N, the input words length.\n\nPairs are unique so removing fro
O(N) runtime due to iteration through `words`.\nO(N) space due to HashSet `wordSet` that may go up to N, the input `words` length.\n\nPairs are unique so removing from HashSet is never needed.\n```\nclass Solution {\n    public int maximumNumberOfStringPairs(String[] words) {\n        int maxPairs = 0;\n        \n        //Iterate through words and insert them into a HashSet\n        //At each word, check if you have seen it\'s reverse\n        Set<String> wordSet = new HashSet<>();\n        \n        for(String word : words) {\n            StringBuilder sb = new StringBuilder(word);\n            String reversedWord = sb.reverse().toString();\n            \n            //We have seen the reverse here, so we increment a pair has been found\n\t\t\t//contains() check is O(1) runtime\n            if(wordSet.contains(reversedWord)) {\n                maxPairs++;\n            }\n            \n            //Always add a word that we have run across\n            wordSet.add(word);\n        }\n        \n        return maxPairs;\n    }\n}\n```
['Java']