In a fictional document management system, input documents are structured with weighted headings. Lowest weighted headings are the most important.
This is a sample document:
H1 All About Birds
H2 Kinds of Birds
H3 The Finch
H3 The Swan
H2 Habitats
H3 Wetlands
From this document we would like to produce an outline using nested ordered lists in HTML, which would look like this when rendered:
- All About Birds
- Kinds of Birds
- The Finch
- The Swan
- Habitats
- Wetlands
- Kinds of Birds
Your code only needs to take the input list and transform it into the expected data structure, which will be printed.
</ol>tags) \$\endgroup\$