Gainsight Interview Question

tree path problem