code: func (c *Category) NumLeafNodes() int {
  	if c.cachedNumLeafNodes != -1 {
  		return c.cachedNumLeafNodes
  	}
  
  	leafNodes := 0
  	for _, child := range c.children {
  		leafNodes += child.NumLeafNodes()
  	}
  	c.cachedNumLeafNodes = leafNodes
  	return c.cachedNumLeafNodes
  }
docs: // NumLeafNodes calculates the number of leaf nodes in Category.