JavaScript Solution - Brute Force
\nvar numOfPairs = function(nums, target) {\n    const n = nums.length;\n    const map = new Map();\n    \n    for (const num of nums) {\n        if (!map.has(n
```\nvar numOfPairs = function(nums, target) {\n    const n = nums.length;\n    const map = new Map();\n    \n    for (const num of nums) {\n        if (!map.has(num)) map.set(num, 0);\n        map.set(num, map.get(num) + 1);\n    }\n    \n    let res = 0;\n    \n    for (const [word1, count1] of map) {\n        for (const [word2, count2] of map) {\n            if (word1 + word2 === target) {\n                if (word1 === word2) {\n                    res += count1 * (count1 - 1);\n                }\n                else {\n                    res += count1 * count2;\n                }\n            }\n        }\n    }\n    \n    return res;\n};\n```
['JavaScript']