String Pairs - JavaScript - Beats 99.46 % ( 56 ms ) 🔥
\n\n1. Solution with two for loops\n\n/**\n * @param {string[]} words\n * @return {number}\n */\nvar maximumNumberOfStringPairs = function(words) {\n    count =
![image.png](https://assets.leetcode.com/users/images/5387b061-43d8-4eb2-ad68-62c894a3d6f3_1687823172.9767308.png)\n\n1. Solution with two for loops\n```\n/**\n * @param {string[]} words\n * @return {number}\n */\nvar maximumNumberOfStringPairs = function(words) {\n    count = 0 \n\n    for (let i = 0; i < words.length; i++) \n        for (let j = i + 1; j < words.length; j++) \n            if (words[i][0] == words[j][1])\n                if (words[i][1] == words[j][0])\n                    count ++            \n           \n    return count\n};\n```\n2. Solution with Hash Table\n```\n/**\n * @param {string[]} words\n * @return {number}\n */\nvar maximumNumberOfStringPairs = function(words) {\n    count = 0 \n    obj = {}\n    \n    for (word of words) {\n        reverse = word[1] + word[0]        \n\n        if (obj[reverse] == true) count ++\n\n        obj[word] = true        \n    }    \n    \n    return count\n};\n```\nPlease put likes, leave comments, share my solution, I try to find the best solutions)
['Hash Table', 'JavaScript']