← ALL NOTES
Array

1726. Tuple with Same Product

Given distinct positive integers, count tuples (a,b,c,d) with a·b = c·d and all four distinct. Group pairs by their product: if k pairs share a product, they yield C(k,2) combinations of two pairs,…

Loading…