Python3 solution || easy to understand || beginner's friendly
Code\n\nclass Solution:\n    def numTriplets(self, nums1: List[int], nums2: List[int]) -> int:\n        Map1 = Counter([n * n for n in nums1])\n        Map2 = C
# Code\n```\nclass Solution:\n    def numTriplets(self, nums1: List[int], nums2: List[int]) -> int:\n        Map1 = Counter([n * n for n in nums1])\n        Map2 = Counter([n * n for n in nums2])\n\n        res = 0\n        for i in range(len(nums1) - 1):\n            for j in range(i + 1, len(nums1)):\n                res += Map2[nums1[i] * nums1[j]]\n\n        for i in range(len(nums2) - 1):\n            for j in range(i + 1, len(nums2)):\n                res += Map1[nums2[i] * nums2[j]]\n\n        return res\n```
['Hash Table', 'Python3']