Sponsored
Use these hints if you're stuck. Try solving on your own first.
Find the frequency (number of occurrences) of all elements in the array.
For each element, iterate through its multiples and multiply frequencies to find the answer.
Solve with full IDE support and test cases