Pregunta de entrevista de Autodesk

Segment tree and graph question