c++ code using hashmap
\nclass Solution {\npublic:\n    unordered_map<double,int> hash1;\n    unordered_map<double,int> hash2;\n    int numTriplets(vector<int>& nums1, vector<int>& nu
```\nclass Solution {\npublic:\n    unordered_map<double,int> hash1;\n    unordered_map<double,int> hash2;\n    int numTriplets(vector<int>& nums1, vector<int>& nums2) {\n        for(int i=0;i<nums1.size();i++)\n        {if(hash1.find(nums1[i])==hash1.end()) hash1[nums1[i]]=1;\n         else hash1[nums1[i]]++; \n        }\n        for(int i=0;i<nums2.size();i++)\n        {if(hash2.find(nums2[i])==hash2.end()) hash2[nums2[i]]=1;\n         else hash2[nums2[i]]++;\n        }\n\n        int count=0;\n        for(int i=0;i<nums2.size();i++){\n            for(int j=i+1;j<nums2.size();j++){\n                double p=sqrt((double)nums2[i]*(double)nums2[j]);\n                if(hash1.find(p)!=hash1.end()) count=count+hash1[p];\n            }\n        }\n        for(int i=0;i<nums1.size();i++){\n            for(int j=i+1;j<nums1.size();j++){\n                double p=sqrt((double)nums1[i]*(double)nums1[j]);\n                if(hash2.find(p)!=hash2.end()) count=count+hash2[p];\n            }\n        }\n    return count;\n    }\n};\n```
[]