Scanline--An efficient way to count numbers of covers
Problem: Line Covers
There are n line segments on a coordinate axis.
The coordinates of each endpoint of each line segment are integers.
There may be line segments that degenerate into points.
Line segments can cross, nest or even overlap each other....
yaohui.hashnode.dev2 min read