class MyCalendar {
var orderArray:[[Int]]
init() {
orderArray = []
}
func book(_ start: Int, _ end: Int) -> Bool {
for temp in orderArray {
if (start < temp[1] && end > temp[0]){
return false
}
}
orderArray.append([start,end])
return true
}
}
网友评论