Error:
cannot solve it.
- sort the array base on event type and its index
- handle it with different case:
- when meet start point and its height is higher than current max., insert it to res
- when meet end point and 1) current max. equal to its height, 2) no other pointer’s height in the queue has same height as end point, insert it to res
Note:
- careful with the sorting, if has same index, 1)sort larger first when start and 2) sort smaller first when end 3) if one is start and one is end, put start first
- take care of end type, first use a priority queue to keep track current max. height, and use hashmap to know current height number