How to solve this problem?
Statement: Given N nodes of a tree, answer Q queries of 2 types(update value of some node or find the number of distinct numbers on the path from U to V).
There is a solution with Mo's algorithm with updates and I don't understand that as well. Can anyone explain any other approach or even this one?