[LC-1577-M | Python3] A Plain Solution
Use collections.Counter and iterations to count.\n\npython3 []\nclass Solution:\n    def numTriplets(self, nums1: List[int], nums2: List[int]) -> int:\n        
Use `collections.Counter` and iterations to count.\n\n```python3 []\nclass Solution:\n    def numTriplets(self, nums1: List[int], nums2: List[int]) -> int:\n        sq_cnter1 = Counter([num**2 for num in nums1])\n        sq_cnter2 = Counter([num**2 for num in nums2])\n\n        def count(nums, sq_cnter):\n            n = len(nums)\n            cnt = 0\n            for i in range(n-1):\n                for j in range(i+1, n):\n                    cnt += sq_cnter[nums[i]*nums[j]]\n            return cnt\n        \n        return count(nums1, sq_cnter2) + count(nums2, sq_cnter1)\n```
['Python3']