Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
2-liner: 140 chars solution in Creative category for Tree Walker by Phil15
P=lambda T:[T]+[p for c in(T.values()if dict==type(T)else((),T)[type(T)==list])for p in P(c)]
tree_walker=lambda T,t:sum(p==t for p in P(T))
Jan. 17, 2020
Comments: