I was tasked to solve this question on a programming exam but I was not able to solve it. I am really curious of what is the solution to this task:
Make an ap