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 SPOJ.com - Problem GSS2

1 Like