python soln
\nclass Solution:\n    def numTriplets(self, nums1: List[int], nums2: List[int]) -> int:\n        hash1=defaultdict(int)\n        hash2=defaultdict(int)\n      
```\nclass Solution:\n    def numTriplets(self, nums1: List[int], nums2: List[int]) -> int:\n        hash1=defaultdict(int)\n        hash2=defaultdict(int)\n        \n        for x in nums1:\n            hash1[x*x]+=1\n        \n        for x in nums2:\n            hash2[x*x]+=1\n        \n        res=0\n        for i in range(len(nums1)-1):\n            for j in range(i+1,len(nums1)):\n                \n                res+=hash2[nums1[i]*nums1[j]]\n        \n        for i in range(len(nums2)-1):\n            for j in range(i+1,len(nums2)):\n                \n                res+=hash1[nums2[i]*nums2[j]]\n        return res\n        \n                \n                \n        \n        \n```
['Python']