第一题:类似meeting rooms,输入是一个int[][] meetings, int start, int end, 每个数都是时间,13:00 =》 1300, 9:30 =》 18930, 看新的meeting 能不能安排到meetings
ex: {[1300, 1500], [930, 1200],[830, 845]}, 新的meeting[820, 830], return true; [1450, 1500] return false;
public boolean isSchedule(int[][] meetings, int start, int end)
{
for(int i = 0; i< meetings.length; i++)
{
meetingStart = meetings[i][0];
meetingEnd = meetings[i][1];
if((start < meetingEnd && meetingEnd < end) ||
(meetingStart < end && end <= meetingEnd) ||
(start <= meetingStart && meetingEnd <= end))
{
return false;
}
}
return true;
}