Help me out not able to get the logic of this
@shivammishra20121999 see this logic and try to build the code.
// Since we need to find the MHT roots, we can think of it as finding
// the nodes which are sort of in the middle of the graph and not near
// the corners. If a node is near a corner and picked as a root
// then for it the height will include all the nodes which come on the way from
// another extreme point. Like if a leaf node is picked then height is taken all the
// way from root in a normal binary tree, but if we pick a node in level 2 in a 3 level tree
// then the chances of it having least height decreases, so we need to find the
// nodes which lie in a mid point distance of max distance.
// 1
// 2 3
// 4 5 6 7, if 4,5,6 or 7 is picked h = 5, 2 and 3 gives h=4, whereas 1 gives h=3
// find the indegree of each node and use BFS to get to the nodes connected in a central position
// So naturally it all starts with leaf nodes, remove them in each iteration to get to the central ones
