Dictionary & List || Python
Code\n\nclass Solution:\n    def numOfPairs(self, nums: List[str], target: str) -> int:\n        d = defaultdict(int)\n        for char in nums:\n            d[
# Code\n```\nclass Solution:\n    def numOfPairs(self, nums: List[str], target: str) -> int:\n        d = defaultdict(int)\n        for char in nums:\n            d[char] += 1\n            \n        arr = []\n        for char in target:\n            arr.append(char)\n        \n        pairs = 0\n        num = ""\n        while len(arr) > 1:\n            num += arr.pop()\n            findNum = "".join(arr)\n            if num[::-1] not in d or findNum not in d:\n                continue\n\n            c1 = d[num[::-1]]\n            d[num[::-1]] -= 1 #reduce the count as we dont want to count it again if the other part is also same.\n            \n            c2 = d[findNum]\n            d[num[::-1]] += 1 # make the count again same.\n\n            pairs += c1 * c2\n        return pairs\n        \n```
['Python3']