SWIFT: whole minute dilemma - Swift solution
func playlist(songs: [Int]) -> Int {
var count = 0
for i in 0..<songs.count {
for j in (i+1)..<songs.count {
if ((songs[i] + songs[j]) % 60 == 0) {
count += 1
}
}
}
return count
}
whole minute dilemma |
Sign up here with your email
ConversionConversion EmoticonEmoticon