I've used calculation fields to take the effort out of both challenges. For part 1 I think that the calculation field is going to perform well across large sets. In part 2 the calculation I've used is only suitable for small data sets with limited recursion. It works in this context.

Malcolm

I solved part 1 with short way. Only the root appears once in the list.

//adding spaces at head and tail so that avoiding partial match.

Let ( [

$s = " " & Substitute ( Puzzle::Puzzle ; [ "," ; " ," ] ; [ ¶ ; " " & ¶ & " " ] ) & " " ;

$space = " " ;

$n = ValueCount($s) ;

$i = 1 ;

$f = "Let([$node=LeftWords(GetValue($s;$i);1);$i=$i+1];PatternCount($s;$space&$node&$space)=1 or $i>$n);1;" ;

$f2 = "Case(" & Substitute ( 10^400-1; 9; $f ) & "0)" ;

$f3 = "Case(" & Substitute ( 10^400-1; 9; "Evaluate($f2);1;" ) & "0)" ;

$r = Evaluate ( $f3 )

] ;

Case ( $r = 1 ; $node ; "not found" )

)

But now I saw part 2, this answer helps nothing on part 2