1
class Solution {
2
public int numPairsDivisibleBy60(int[] time) {
3
int[] hm = new int[61];
4
int n = time.length;
5
for (int i = 0; i < n; i++) time[i] = time[i] % 60;
6
int res = 0;
7
for (int i = 0; i < n; i++) {
8
if (hm[60 - time[i]] != 0) res = res + hm[60 - time[i]];
9
if (time[i] == 0) hm[60] += 1;
10
else hm[time[i]] += 1;
11
}
12
return res;
13
}
14
}

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0