Find minimum and maximum value in the path from LCA to a
while i < len ( Path1 ) : NEW_LINE INDENT if min1 > Path1 [ i ] : NEW_LINE INDENT min1 = Path1 [ i ] NEW_LINE DEDENT if max1 < Path1 [ i ] : NEW_LINE INDENT max1 = Path1 [ i ] NEW_LINE DEDENT i += 1 NEW_LINE DEDENT