https://blog.firedrake.org/archive/2020/05/Perl_Weekly_Challenge_59__linked_list_and_bit_sum.html