A playlist holds songs whose lengths, in seconds, are time[0], time[1], …. Two different songs make a whole-minute pair when their lengths add up to an exact number of minutes, that is, to a multiple of 60 seconds.
Return how many whole-minute pairs the playlist has: the number of index pairs i < j with (time[i] + time[j]) % 60 == 0. A song can't pair with itself, but it can belong to many pairs.
45 pairs with 75 (120 seconds) and with 15 (60). 105 also pairs with 75 (180) and with 15 (120). Nothing else adds up to a multiple of 60: the 120 could only pair with another song that is a whole number of minutes long.
Each length is a whole number of minutes plus half a minute, so any two of them make a whole number of minutes. Four songs give 6 pairs.
One song can't make a pair.
Constraints
1 <= time.length <= 6 × 10⁴1 <= time[i] <= 500Only each length's remainder mod 60 matters: two songs make a pair exactly when their remainders add up to 0 or 60.
4