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
- leetcode 掃描線專題 06-leetcode.252 meeting room 力扣.252 會議室LeetCodeOOM力扣
- LeetCode #252 - Meeting RoomsLeetCodeOOM
- [LintCode/LeetCode] Meeting RoomsLeetCodeOOM
- leetcode-252-Meeting RoomsLeetCodeOOM
- LeetCode252 Meeting RoomsLeetCodeOOM
- [Leetcode]253. Meeting Rooms IILeetCodeOOM
- 【LeetCode】253. Meeting Rooms II 解題報告(C++)LeetCodeOOMC++
- leetcode題解(0-1揹包問題)LeetCode
- LeetCode 252. Meeting Rooms (Java版; Easy)LeetCodeOOMJava
- LeetCode問題LeetCode
- Leetcode 253:Meeting Rooms II(超詳細的解法!!!)LeetCodeOOM
- Leetcode刷題系列彙總LeetCode
- Leetcode第1~10題LeetCode
- Leetcode每日一題(1)LeetCode每日一題
- Leetcode題解1-50題LeetCode
- leetcode題解(陣列問題)LeetCode陣列
- Android Architecture Components Part1:RoomAndroidOOM
- LeetCode數學問題(Python)LeetCodePython
- leetcode.最小棧問題LeetCode
- leetcode題解(查詢表問題)LeetCode
- LeetCode #1:Two Sum(簡單題)LeetCode
- 【leetcode】揹包問題彙總LeetCode
- Leetcode 演算法題解系列 - 最小棧LeetCode演算法
- LeetCode刷題記錄——day1LeetCode
- [LeetCode 刷題] 1. 兩數之和LeetCode
- LeetCode題集-1- 兩數之和LeetCode
- LeetCode 3: PairsOfParentheses (括號匹配問題)LeetCodeAI
- LeetCode—253.會議室 II(Meeting Rooms II)——分析及程式碼(C++)LeetCodeOOMC++
- 關於Room資料庫,拼寫模糊查詢語句遇到的問題OOM資料庫
- leetcode Sum系列LeetCode
- LeetCode每日一題:兩數之和(No.1)LeetCode每日一題
- #leetcode刷題之路1-兩數之和LeetCode
- leetCode解題記錄1 - 兩數之和LeetCode
- 模板問題:Knapsack (LeetCode: Coin Change)[揹包問題九講筆記]LeetCode筆記
- LeetCode 64號問題 最小路徑和LeetCode