For Tree sequence problem. Can you please explain the idea a little bit please?
I used HLD + seg_tree. In each node I store the whether the current range is increasing or not, and if there are ‘-1’ in between I stored the answer (as we know what is the max and min we can put there). So at each node we have at most two ranges for which we don’t know the answer (the left end and the right end).
I know it’s very hard to find mistake in the solution. But if possible can you please look at approach and can tell whether my approach is correct or not? Please …