C++ code using unordered_map
\nclass Solution {\npublic:\n    int get(vector<int>& nums1, vector<int>& nums2)\n    {\n        unordered_map<long long int,long long int>m;int ans=0;\n       
```\nclass Solution {\npublic:\n    int get(vector<int>& nums1, vector<int>& nums2)\n    {\n        unordered_map<long long int,long long int>m;int ans=0;\n        for(int i=0;i<nums1.size();i++)\n        {\n            m[(long long )nums1[i]*nums1[i]]++;\n        }\n        for(int i=0;i<nums2.size();i++)\n        {\n            for(int j=i+1;j<nums2.size();j++)\n            {\n                if(m.find((long long)nums2[i]*nums2[j])!=m.end())ans+=m[(long long)nums2[i]*nums2[j]];\n            }\n        }return ans;\n    }\n    int numTriplets(vector<int>& nums1, vector<int>& nums2) {\n      return get(nums1,nums2)+get(nums2,nums1);}\n}; \n```
['C']