Iām trying to solve this problem Problem link.
I am solving it offline using a segment tree that stores all node values. But unfortunately getting TLE for many times
Can anyone tell me any different approach or how should I do some optimisation?
Iām trying to solve this problem Problem link.
I am solving it offline using a segment tree that stores all node values. But unfortunately getting TLE for many times
Can anyone tell me any different approach or how should I do some optimisation?