Search
⌘K

Leetcode 1862. Sum of Floored Pairs

Compute the sum of floor(nums[i] / nums[j]) over all index pairs (mod 10^9+7). The challenge is to avoid O(n^2) by using value frequency/count arrays and iterating over possible quotient ranges or multiples (values and n up to 10^5) to accumulate contributions efficiently.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.