Distinct Dishting!!

You are given an array of N integers. Then there will be Q commands of the following type: Change …

Click here to read the complete problem statement.


If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.

i use segment tree for this problem but i’m unable to find the duplicate value of given range…
when i calculate the sum of bottomest node then i separete the duplicate value…But above them i’m unable…
how can i ignore duplicate value using segment tree??

You can solve this problem only if you are familiar with Mo’s with Update technique.