GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — LeetCode/Others/252.Meeting-Rooms at master · wisdompeak/LeetCode

Expand file tree

/

252.Meeting-Rooms

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

252.Meeting-Rooms

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
252.Meeting-Rooms.cpp
252.Meeting-Rooms.cpp
 
 
Readme.md
Readme.md
 
 

Readme.md

252.Meeting-Rooms

遍历所有的interval,将这样所有的{start,1}和{end,-1}加入一个数组q.然后将q排序.注意,对于同一个时刻,{end,-1}会比{start,1}先处理.这在本题是合理的,因为所有的有效区间的长度都至少为1,这样的话类似[t,t]这样的区间就不会被包括进来.

我们依次遍历这个q的元素,将第二个label的值累加进count.发现当count>1时,即说明有两个重合的区间,返回false

Leetcode Link

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.