Python3 Solution
python\ndef numTriplets(self, nums1: List[int], nums2: List[int]) -> int:\n\trev, n1, n2 = 0, Counter(nums1), Counter(nums2)\n\n\tfor i in range(len(nums1)-1):\
```python\ndef numTriplets(self, nums1: List[int], nums2: List[int]) -> int:\n\trev, n1, n2 = 0, Counter(nums1), Counter(nums2)\n\n\tfor i in range(len(nums1)-1):\n\t\tfor j in range(i+1, len(nums1)):\n\t\t\tt = (nums1[i] * nums1[j])**(1/2)\n\n\t\t\tif t == int(t) and t in n2:\n\t\t\t\trev += n2[t]\n\n\tfor i in range(len(nums2)-1):\n\t\tfor j in range(i+1, len(nums2)):\n\t\t\tt = (nums2[i] * nums2[j])**(1/2)\n\n\t\t\tif t == int(t) and t in n1:\n\t\t\t\trev += n1[t]\n\n\treturn rev\n```
['Python', 'Python3']