Skip to content

Latest commit

 

History

History
20 lines (18 loc) · 510 Bytes

File metadata and controls

20 lines (18 loc) · 510 Bytes

Screen Shot 2022-08-24 at 00 17 51

/**
 * @param {number[]} time
 * @return {number}
 */
var numPairsDivisibleBy60 = function(time) {
    let res = 0;
    for(let i = 0; i < time.length; i++) {
        for(let j = i + 1; j < time.length; j++) {
            if((time[i] + time[j]) % 60 === 0) {
                res++;
            }
        }
    }
    return res;
};