python solution
\tclass Solution:\n\t\tdef numTriplets(self, nums1: List[int], nums2: List[int]) -> int:\n\t\t\td1 = collections.defaultdict(int)\n\t\t\td2 = collections.defaul
\tclass Solution:\n\t\tdef numTriplets(self, nums1: List[int], nums2: List[int]) -> int:\n\t\t\td1 = collections.defaultdict(int)\n\t\t\td2 = collections.defaultdict(int)\n\t\t\tres = 0\n\t\t\tfor num1 in nums1:\n\t\t\t\td1[num1 * num1] += 1\n\t\t\tfor num2 in nums2:\n\t\t\t\td2[num2 * num2] += 1        \n\t\t\tfor i in range(len(nums1) - 1):\n\t\t\t\tfor j in range(i + 1, len(nums1)):\n\t\t\t\t\tres += d2[nums1[i] * nums1[j]]\n\t\t\tfor i in range(len(nums2) - 1):\n\t\t\t\tfor j in range(i + 1, len(nums2)):\n\t\t\t\t\tres += d1[nums2[i] * nums2[j]]\n\t\t\treturn res
[]