C++ solution using unordered set
Intuitionsets consists of unique elementsApproachtraverse on the vector, store the reverse of the element
if reversed element is present in set => count++
else
# Intuition
sets consists of unique elements

# Approach
traverse on the vector, store the reverse of the element
if reversed element is present in set => count++
else insert that element into the set

# Complexity
- Time complexity:
$$O(n)$$

- Space complexity:
$$O(n)$$

# Code
```cpp []
class Solution {
public:
    int maximumNumberOfStringPairs(vector<string>& words) {
        int n = words.size();
        int count = 0;
        unordered_set<string> s;
        for(int i = 0; i < n; i++) {
            string rev = words[i];
            reverse(rev.begin(), rev.end());
            if(s.find(rev) != s.end()) count++;
            else s.insert(words[i]);
        }
        return count;
    }
};
```
['C++']