Python || Beats 99.99% || HashMap
\nclass Solution:\n  def numOfPairs(self, nums: List[str], target: str) -> int:\n    hash_map = dict()\n    ans = 0\n    \n    for num in nums:\n\t\n      prefi
```\nclass Solution:\n  def numOfPairs(self, nums: List[str], target: str) -> int:\n    hash_map = dict()\n    ans = 0\n    \n    for num in nums:\n\t\n      prefix = target[:-len(num)]\n      if prefix in hash_map and prefix + num == target:  \n        ans += hash_map[prefix]\n      \n      suffix = target[len(num):]\n      if suffix in hash_map and num + suffix == target:  \n        ans += hash_map[suffix]\n       \n      hash_map[num] = hash_map.get(num, 0) + 1\n      \n    return ans\n```
['Python']