https://fluca1978.github.io/2023/12/11/PerlWeeklyChallenge247.html#task2