I need suggestions for this question which is based upon longest chain of nodes.The problem is described here.