Anders Kaseorg's submission of Trees and Degrees | CodeChef