Python Simple Approach
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: $$O(n^2)$$ \n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(n)$$ \n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def numTriplets(self, nums1: List[int], nums2: List[int]) -> int:\n\n        dic1 = dict()\n        dic2 = dict()\n\n\n        for i in nums1:\n            if dic1.get(i**2) is None:\n                dic1[i**2] = 1\n            else:\n                dic1[i**2] = dic1[i**2] + 1\n\n        for i in nums2:\n            if dic2.get(i**2) is None:\n                dic2[i**2] = 1\n            else:\n                dic2[i**2] = dic2[i**2] + 1\n\n        count = 0\n        idx = 0\n        len_ = len(nums1)\n        \n        while idx < len_:\n            j = idx + 1\n            while j < len_:\n                temp = nums1[idx] * nums1[j]\n                if dic2.get(temp) is not None:\n                    count += dic2[temp] \n                    \n                j += 1\n            idx +=1\n        \n        idx = 0\n        len_ = len(nums2)\n\n        while idx < len_:\n            j = idx + 1\n            while j < len_:\n                temp = nums2[idx] * nums2[j]\n                if dic1.get(temp) is not None:\n                    count += dic1[temp] \n                j += 1\n            idx +=1\n        \n        return count\n        \n        \n```
['Python3']