Leetcode Meeting room問題系列 - 1
這個問題系列就是list裡面每個元素都有一個start和end時間.
google和amazon經常考的題目。
1.Merge Intervals(medium)
https://leetcode.com/problems/merge-intervals/
2. Meeting Rooms (easy)
https://leetcode.com/problems/meeting-rooms/
3. Meeting Rooms II(Medium)
https://leetcode.com/problems/meeting-rooms-ii/
4. Partition Labels(Medlium)
https://leetcode.com/problems/partition-labels/
5. Employee Free Time (hard)
https://leetcode.com/problems/employee-free-time/
這類問題主要是數值範圍交叉問題,比如問題 2,問題3, 問題1
問題2就是給你一個會議時間集合list,每個元素有開始和結束時間。看看是否一個人可以參加所有的會議。
比如下面的例子
Input:[[0,30],[5,10],[15,20]]
Output:false
Example 2:
Input:[[7,10],[2,4]]
Output:true
問題3 同樣也是給你一個會議時間集合list每個元素有開始和結束時間。看看是需要會議室的最小數目
Example 1:
Input:[[0, 30],[5, 10],[15, 20]]
Output:2
Example 2:
Input:[[7,10],[2,4]]
Output:1
問題1 給你一個數字範圍集合list,合併重複的集合。
Example 1:
Input:[[1,3],[2,6],[8,10],[15,18]]
Output:[[1,6],[8,10],[15,18]]
Explanation:Since intervals [1,3] and [2,6] overlaps, merge them into [1,6].
Example 2:
Input:[[1,4],[4,5]]
Output:[[1,5]]
Explanation:Intervals [1,4] and [4,5] are considered overlapping.
問題4 就是給你一個員工的工作時間集合,找出到家共同有空的時間段。Example 1:
Input:schedule = [[[1,2],[5,6]],[[1,3]],[[4,10]]]
Output:[[3,4]]
Explanation:
There are a total of three employees, and all common
free time intervals would be [-inf, 1], [3, 4], [10, inf].
We discard any intervals that contain inf as they aren't finite.
Example 2:
Input:schedule = [[[1,3],[6,7]],[[2,4]],[[2,5],[9,12]]]
Output:[[5,6],[7,9]]
相關文章
- Leetcode Meeting room問題系列 - 2LeetCodeOOM
- Leetcode 252. Meeting Room 253. Meeting Room IILeetCodeOOM
- Leetcode 253: meeting roomLeetCodeOOM
- Facebook面試題 meeting rooms 求同時最多meeting room的時間面試題OOM
- leetcode 掃描線專題 06-leetcode.252 meeting room 力扣.252 會議室LeetCodeOOM力扣
- LeetCode 題解(254) : Meeting RoomsLeetCodeOOM
- Leetcode: Meeting RoomsLeetCodeOOM
- [leetcode] 252. Meeting Rooms 解題報告LeetCodeOOM
- LeetCode #252 - Meeting RoomsLeetCodeOOM
- Leetcode 252 Meeting RoomsLeetCodeOOM
- [LeetCode 252] Meeting RoomsLeetCodeOOM
- [Leetcode] 253. Meeting Rooms II 解題報告LeetCodeOOM
- LeetCode252 Meeting RoomsLeetCodeOOM
- leetcode-252-Meeting RoomsLeetCodeOOM
- LeetCode-Best Meeting PointLeetCode
- LeetCode-Meeting Rooms IILeetCodeOOM
- [LeetCode 253] Meeting Rooms IILeetCodeOOM
- *LeetCode-Meeting Rooms IILeetCodeOOM
- leetcode題解(0-1揹包問題)LeetCode
- [LintCode/LeetCode] Meeting RoomsLeetCodeOOM
- [Leetcode]253. Meeting Rooms IILeetCodeOOM
- [LeetCode] Meeting Rooms 會議室LeetCodeOOM
- [LeetCode253]Meeting Rooms IILeetCodeOOM
- 【LeetCode】253. Meeting Rooms II 解題報告(C++)LeetCodeOOMC++
- Leetcode 252. Meeting Rooms (Easy) (cpp)LeetCodeOOM
- LeetCode 252. Meeting Rooms (Java版; Easy)LeetCodeOOMJava
- LeetCode 252. Meeting Rooms(會議室)LeetCodeOOM
- LeetCode問題LeetCode
- LeetCode 253. Meeting Rooms II(會議室)LeetCodeOOM
- Leetcode刷題系列彙總LeetCode
- HDU 4923 Room and Moor(瞎搞題)OOM
- Leetcode題解1-50題LeetCode
- Leetcode第1~10題LeetCode
- Leetcode每日一題(1)LeetCode每日一題
- Leetcode 253:Meeting Rooms II(超詳細的解法!!!)LeetCodeOOM
- leetcode題解(陣列問題)LeetCode陣列
- leetcode刷題--Number of 1 BitsLeetCode
- leetcode題解(查詢表問題)LeetCode