importance: 5

---

# Show descendants in a tree

There's a tree organized as nested `ul/li`.

Write the code that adds to each `<li>` the number of its descendants. Skip leaves (nodes without children).

The result:

[iframe border=1 src="solution"]
