Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Let <code>f[v]</code> be the number of occurrences of <code>v/k</code> in nums2.
For each value <code>v</code> in nums1, enumerating all its factors <code>d</code> (in <code>sqrt(v)</code> time) and sum up all the <code>f[d]</code> to get the final answer.
Solve with full IDE support and test cases
It is also possible to improve the complexity from <code>len(nums1) * sqrt(v)</code> to <code>len(nums1) * log(v)</code> - How?