Amazon Interview Question

Segment Tree LC hard implementation