Pergunta de entrevista da empresa Twitch

question regarding segment tree and graph theory