title: Find the leaf count for each parent ul in a nested ul structure
body: <p>Given a html structure that looks like the following html, but is of arbitrary depth. (i.e. it could go many levels deeper). Because it is of arbitray depth, I would prefer a solution that doesn't require adding any extra markup to the html (e.g. classes)</p>
  
  <pre><code>&lt;ul&gt;&lt;!-- Leaf Count 3 --&gt;
    &lt;li&gt;branch 1
      &lt;ul&gt;&lt;!-- Leaf Count 2 --&gt;
        &lt;li&gt;leaf 1&lt;/li&gt;
        &lt;li&gt;leaf 2&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;leaf 3&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>How can I count all the leaves that are a child of each ul? So in this example the outer most ul would have 3 leaves and the nested one two leaves. This seems like a recursion issue, but I can't think through it.</p>