I found some small bugs in the code, and here are my solutions. The second is not optimal, as empty TOC should be populated inside the "initialisation" section before all else, but that seemed kind of like a huge diff to me. I wouldn't blame you to implement this differently.
I found some small bugs in the code, and here are my solutions. The second is not optimal, as empty TOC should be populated inside the "initialisation" section before all else, but that seemed kind of like a huge diff to me. I wouldn't blame you to implement this differently.