0056_merge-intervals

command
v0.0.0-...-60194e6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2020 License: Unlicense Imports: 0 Imported by: 0

README

0056_merge-intervals

气球涂色。

因为区间范围在10^4这个数量级, 一次遍历还是能做到的。

开辟这个长度为10^4 + 1的区间。每个区间开始的位置+1,结束的位置-1

遍历的时候累加,累加值大于0时就是在某个连续区间内。

注意:

  • 题目描述的开闭区间。
  • 存在start == end的情况,题目没有给出例子。
    • 如果发生在面试,应该提出这个情况并要求详细的说明。

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL