[Python3] Solution with using "two sum" principal
\nclass Solution:\n    def numOfPairs(self, nums: List[str], target: str) -> int:\n        d = collections.defaultdict(int)\n        \n        for num in nums:\
```\nclass Solution:\n    def numOfPairs(self, nums: List[str], target: str) -> int:\n        d = collections.defaultdict(int)\n        \n        for num in nums:\n            d[num] += 1\n        \n        res = 0\n        for num in nums:\n            if len(num) < len(target) and num == target[:len(num)]:\n                val = target[len(num):]\n                val_cnt = d[target[len(num):]]\n                if val == num:\n                    val_cnt -= 1\n                    \n                res += val_cnt\n        \n        return res\n```
['Python3']