Hashing || Super Simple || C++
Code\n\nclass Solution \n{\npublic:\n    int numTriplets(vector<int>& nums1, vector<int>& nums2) \n    {\n        map<long long,int> m1, m2;\n        for(auto n
# Code\n```\nclass Solution \n{\npublic:\n    int numTriplets(vector<int>& nums1, vector<int>& nums2) \n    {\n        map<long long,int> m1, m2;\n        for(auto n: nums1) m1[(long long)n*n]++;\n        for(auto n: nums2) m2[(long long)n*n]++;\n        int ans=0;\n        for(int x=0; x<nums2.size(); x++)\n        {\n            for(int y=x+1; y<nums2.size(); y++)\n            {\n                ans+=m1[(long long)nums2[x]*nums2[y]];\n            }\n        }\n        for(int x=0; x<nums1.size(); x++)\n        {\n            for(int y=x+1; y<nums1.size(); y++)\n            {\n                ans+=m2[(long long)nums1[x]*nums1[y]];\n            }\n        }\n        return ans;\n    }\n};\n```
['C++']