LeetCode: 1010-Pairs of Songs With Total Durations Divisible by 60 解題紀錄
題目
You are given a list of songs where the ith song has a duration ofRead More »LeetCode: 1010-Pairs of Songs With Total Durations Divisible by 60 解題紀錄time[i]
seconds. Return the number of pairs of songs for which their total duration in seconds is divisible by 60. Formally, we want the number of indicesi
,j
such thati < j
with(time[i] + time[j]) % 60 == 0
.