Simple Java with Iterator
Approach\nI used Iterator and StringBuffer.reverse() for easy and simple solution.\n\n# Code\n\nclass Solution {\n    public int maximumNumberOfStringPairs(Stri
# Approach\nI used Iterator and StringBuffer.reverse() for easy and simple solution.\n\n# Code\n```\nclass Solution {\n    public int maximumNumberOfStringPairs(String[] words) {\n        List<String> wordsList = new ArrayList(Arrays.asList(words));\n        int count = 0;\n        for (Iterator<String> wordsIterator = wordsList.iterator(); wordsIterator.hasNext();) {\n            String word = wordsIterator.next();\n            wordsIterator.remove();\n            if (wordsList.contains(reverse(word))) count++;\n        }\n        return count;\n    }\n\n    private String reverse(String input) {\n        return new StringBuffer(input).reverse().toString();\n    }\n}\n```
['String', 'Iterator', 'Java']