https://fluca1978.github.io/2021/12/13/PerlWeeklyChallenge143.html#task2