Python 7-line counter solution | 2-sum in string
\ndef numOfPairs(self, nums: List[str], tar: str) -> int:\n\tcnter, ans = Counter(nums), 0\n\tfor n in cnter:\n\t\tif n+n==tar:\n\t\t\tans += cnter[n]*(cnter[n]
```\ndef numOfPairs(self, nums: List[str], tar: str) -> int:\n\tcnter, ans = Counter(nums), 0\n\tfor n in cnter:\n\t\tif n+n==tar:\n\t\t\tans += cnter[n]*(cnter[n]-1)\n\t\telif tar[:len(n)]==n:\n\t\t\tans += cnter[n]*cnter[tar[len(n):]]\n\treturn ans\n```
[]