✅[Python] Simple and Clean, beats 88%✅
Please upvote if you find this helpful. \u270C\n\n\n\n# Intuition\nThe problem asks us to find the maximum number of pairs that can be formed from a given list 
### Please upvote if you find this helpful. \u270C\n<img src="https://assets.leetcode.com/users/images/b8e25620-d320-420a-ae09-94c7453bd033_1678818986.7001078.jpeg" alt="Cute Robot - Stable diffusion" width="200"/>\n\n\n# Intuition\nThe problem asks us to find the maximum number of pairs that can be formed from a given list of words, where two words can be paired if one is the reverse of the other. We can use a set to keep track of the reversed versions of the words we have seen so far, and increment our answer whenever we encounter a word that is already in the set.\n\n# Approach\n1. Initialize an empty set `strings` to keep track of the reversed versions of the words we have seen so far.\n2. Initialize a variable `ans` to 0 to keep track of the number of pairs we have found.\n3. Iterate over each word `w` in `words`.\n4. If `w` is in `strings`, increment `ans` by 1.\n5. Otherwise, add the reversed version of `w` to `strings`.\n6. Return `ans`.\n\n# Complexity\n- Time complexity: $$O(nk)$$, where $$n$$ is the number of words and $$k$$ is the maximum length of a word.\n- Space complexity: $$O(nk)$$, where $$n$$ is the number of words and $$k$$ is the maximum length of a word.\n\n\n# Code\n```\nclass Solution:\n    def maximumNumberOfStringPairs(self, words: List[str]) -> int:\n        strings = set()\n        ans = 0\n        for w in words:\n            if w in strings:\n                ans += 1\n            else:\n                strings.add(w[::-1])\n        return ans\n```
['Array', 'Hash Table', 'String', 'Ordered Set', 'Python3']