1
class Solution:
2
def sumOfFlooredPairs(self, nums: List[int]) -> int:
3

4
incs, counter = [0] * (max(nums) + 1), Counter(
5
nums
6
) # To store all the quotients increases; counter
7
for num in counter: # Loop over all the divisors
8
for j in range(
9
num, len(incs), num
10
): # Loop over all the possible dividends where the quotient increases
11
incs[j] += counter[num] # Increment the increases in quotients
12
quots = list(
13
accumulate(incs)
14
) # Accumulate the increases to get the sum of quotients
15
return (
16
sum([quots[num] for num in nums]) % 1_000_000_007
17
) # Sum up all the quotients for all the numbers in the list.

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0