https://fluca1978.github.io/2022/01/10/PerlWeeklyChallenge147.html#task2pg