remainders
of size 60 to zero, which will hold the frequency of each remainder.count
to zero, which will hold the number of valid pairs.time
array.
a. Calculate the remainder of the current song duration divided by 60.
b. If the remainder is 0, increment count
by the frequency of 0 in remainders
(since a pair of zeros will sum to 60).
c. Otherwise, increment count
by the frequency of the complement remainder (60 - current remainder).
d. Increment the frequency of the current remainder in remainders
.count
.