I’m publishing my answers to the exam, in case they may help you with the makeup. There are many equivalent answers, that achieve the same result with different code. Here I’m showing one possible answer, usually shorter than others.
To see the solutions follow this link.