In this chapter I used the following libraries
import Base.Iterators.takewhile as takewhile
import BenchmarkTools as Bt # external library
Those were used only for the chapter’s extras and are not strictly necessary to solve the task.
Anyway, you may compare your own solution with the one in this chapter’s text (with explanations) or with the code snippets (without explanations).