Leetcode 252Meeting Rooms
来源:互联网 发布:windows ble蓝牙开发 编辑:程序博客网 时间:2024/04/28 03:11
Given an array of meeting time intervals consisting of start and end times
[[s1,e1],[s2,e2],...]
(si < ei), determine if a person could attend all meetings.For example,
Given
return
Understand the problem:Given
[[0, 30],[5, 10],[15, 20]]
,return
false
.The problem looks very similar to the merge interval and insert intervals. So the idea is still the same: first sort the intervals according to the start times, then check if there is any overlap.
所以正确的解法是将intervals中所有的interval都按start time进行排序,然后判断是否有overlap,如果有overlap就返回false,否则返回true。
The idea is from here
http://buttercola.blogspot.com/2015/08/leetcode-meeting-rooms.html
0 0
- [LeetCode 252] Meeting Rooms
- [leetcode 252] Meeting Rooms
- Leetcode 252Meeting Rooms
- Leetcode 252 meeting rooms
- Leetcode NO.252 Meeting Rooms
- Leetcode: Meeting Rooms
- *LeetCode-Meeting Rooms II
- Leetcode-252.Meeting Rooms
- LeetCode 252. Meeting Rooms
- leetcode Meeting Rooms II
- LeetCode 题解(254) : Meeting Rooms
- [LeetCode 253] Meeting Rooms II
- Leetcode 253Meeting Rooms II
- [LeetCode 253] Meeting Rooms II
- Leetcode Everyday: 252. Meeting Rooms
- LeetCode 253. Meeting Rooms II
- [LeetCode]Meeting Rooms II
- LeetCode 252. Meeting Rooms 会议室
- LeetCode_40 Combination Sum II
- 【Leetcode】Copy List with Random Pointer
- how to get current path in qt
- xfire客户端调用cxf服务端,一直报错
- hdu 1806 RMQ
- Leetcode 252Meeting Rooms
- Leetcode 253Meeting Rooms II
- Leetcode 296Best Meeting Point
- 202——砖块染色问题 Blocks (POJ 3734)
- 如何让win7崩溃
- Leetcode 286.Walls and Gates
- 【Leetcode】Lowest Common Ancestor of a Binary Search Tree
- LeetCode_44 Wildcard Matching
- linux-C 打印出不同数据类型字节数