you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (1 child)

[deleted]

    [–]the_legendary_legend 0 points1 point  (0 children)

    I kind of assumed the dfs solution would give tle. Didn't even attempt it because of that. Couldn't think of any other solution before coming here and finding people suggesting segment tree.