### ujjawalrana001's blog

By ujjawalrana001, history, 7 weeks ago,

Hello codeforces! can anyone explain me the test case of this question ? Thanks in advance :)

• +1

 » 7 weeks ago, # | ← Rev. 7 →   0 consider the graph of the test case. 1 5 |\ 2 4 | 3you notice that number of groups is max number of levels which will be 3 in this case because: level 1: nodes 1,5. level 2 : nodes 2,4. level 3 : nodes 3.which will form groups in it there are not any superior of another in same group. to calculate answer you will use bfs algorithm for graph .hope it well.
•  » » 7 weeks ago, # ^ |   +1 Thanks @beethoven97for helping me....yeah now it is clear :)
•  » » 3 weeks ago, # ^ |   0 will it works if i approach the problem with height of the binary tree?
•  » » 3 weeks ago, # ^ |   0 can you explain how to construct the tree in this particular problem? i guess this can be done only through graph adjacency list.