Approach hintTry it first, then revealHide
Multiply both sides by a[i] - a[j], which is non-zero because all values are distinct. Look for a form in which an expression of a[i] alone equals the same expression of a[j], then count equal keys.
Multiply both sides by a[i] - a[j], which is non-zero because all values are distinct. Look for a form in which an expression of a[i] alone equals the same expression of a[j], then count equal keys.