hash c solution
\nint cal(int* nums1, int nums1Size, int* nums2, int nums2Size){\n    int* hash2 = (int*)calloc(1e5+1, sizeof(int));\n    int ans = 0;\n    long long tmp;\n    
```\nint cal(int* nums1, int nums1Size, int* nums2, int nums2Size){\n    int* hash2 = (int*)calloc(1e5+1, sizeof(int));\n    int ans = 0;\n    long long tmp;\n    for(int i = 0; i < nums2Size; i++){\n        for(int j = 0; j < nums1Size; j++){\n            tmp = nums1[j];\n            tmp *= nums1[j];\n            if(tmp % nums2[i] == 0){\n                /* constraints: 1 <= nums1[i], nums2[i] <= 1e5 */\n                ans += tmp / nums2[i] <= 1e5? hash2[tmp / nums2[i]] : 0;\n            }\n        }\n        hash2[nums2[i]]++;\n    }\n    free(hash2);\n    return ans;\n}\n\nint numTriplets(int* nums1, int nums1Size, int* nums2, int nums2Size) {\n    return cal(nums1, nums1Size, nums2, nums2Size) + cal(nums2, nums2Size, nums1, nums1Size);\n}\n```
['C']