SPOJ - GSS2

I want to know what attributes should we keep in the build tree, I was thinking of taking set in each node but the task of merging the two would lead me to traverse the at least one set which I don’t think so will be affordable, or maybe I am wrong.Any help.The link of the problem https://www.spoj.com/problems/GSS2/

1 Like