I am not able to solve this Q:-
Can somebody help me in solving this Q.
( I know this Q can be solved using Binary Trees but I am not able to solve it. )
I am not able to solve this Q:-
Can somebody help me in solving this Q.
( I know this Q can be solved using Binary Trees but I am not able to solve it. )
Hey,you can solve it using maps only.You don’t need tree.
Ok Sir. Thanks for the solution.
A friend of mine has done this Q in this way using Segment Trees:-