leetcode/0715.Range-Module/README.md
A Range Module is a module that tracks ranges of numbers. Your task is to design and implement the following interfaces in an efficient manner.
addRange(int left, int right) Adds the half-open interval [left, right), tracking every real number in that interval. Adding an interval that partially overlaps with currently tracked numbers should add any numbers in the interval [left, right) that are not already tracked.queryRange(int left, int right) Returns true if and only if every real number in the interval [left, right) is currently being tracked.removeRange(int left, int right) Stops tracking every real number currently being tracked in the interval [left, right).Example 1:
addRange(10, 20): null
removeRange(14, 16): null
queryRange(10, 14): true (Every number in [10, 14) is being tracked)
queryRange(13, 15): false (Numbers like 14, 14.03, 14.17 in [13, 15) are not being tracked)
queryRange(16, 17): true (The number 16 in [16, 17) is still being tracked, despite the remove operation)
Note:
[left, right) denotes all real numbers left <= x < right.0 < left < right < 10^9 in all calls to addRange, queryRange, removeRange.addRange in a single test case is at most 1000.queryRange in a single test case is at most 5000.removeRange in a single test case is at most 1000.Range 模块是跟踪数字范围的模块。你的任务是以一种有效的方式设计和实现以下接口。
示例:
addRange(10, 20): null
removeRange(14, 16): null
queryRange(10, 14): true (区间 [10, 14) 中的每个数都正在被跟踪)
queryRange(13, 15): false (未跟踪区间 [13, 15) 中像 14, 14.03, 14.17 这样的数字)
queryRange(16, 17): true (尽管执行了删除操作,区间 [16, 17) 中的数字 16 仍然会被跟踪)
提示:
addRange,查询区间 queryRange,移除区间 removeRange 三种操作。查询区间的操作需要更加高效一点。