Extract the first and last paragraph of each section of the document to construct a summary. By each section, we mean the smallest subsection of the document. For example, if there is section 1.1, 1.2, 1.3, 1.4, 1.5, we want the first and last paragraph of each of these sections. If a section has 2 paragraphs, the whole section will be extracted, which is fine. If a section has 1 paragraph, we want the whole section, but make sure that the same paragraph is not extracted twice. If section 2 does not have subsections, we want the first and last paragraph of the whole section 2, and so on for the other sections of the document. Note that the sections could be named in many different formats, (Intro, chapter 2, conclusion, etc), and the code should work for all different section naming.
We are giving you a few documents to try your code on. You are recommended, but not required to try the code on other documents on your own.