Python| pass with accumulate frequencys of nums^2
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:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n# Code\n```\nclass Solution(object):\n    def numTriplets(self, nums1, nums2):\n        """\n        :type nums1: List[int]\n        :type nums2: List[int]\n        :rtype: int\n        """     \n        square1 = map(lambda x : x* x, nums1)\n        square2 = map(lambda x : x* x, nums2)\n        #frequency of nums1^2 and nums2^2\n        freq1, freq2 = defaultdict(int),defaultdict(int)\n        m1, m2 = range(len(nums1)), range(len(nums2))\n        for i in m1:\n            freq1[square1[i]] += 1\n        for i in m2:\n            freq2[square2[i]] += 1\n            \n        Ans = 0\n        #type1\n        for item in freq1:\n            for j in m2:\n                if item % nums2[j] == 0: \n                    k = item / nums2[j]\n                    Ans += nums2[j+1:].count(k) * freq1[item]\n        #type2\n        for item in freq2:\n            for j in m1:\n                if item % nums1[j] == 0:\n                    k = item / nums1[j]\n                    Ans += nums1[j+1:].count(k) * freq2[item]\n\n        return Ans\n```
['Python']