#!/usr/bin/env rakuusev6;
subbit-diff( UInt$a, UInt$b ) {
[+] ($a +^ $b).base(2).comb;
}
#| Give the sum of the differences in bits between all the combinations of inputssubMAIN (
*@valswhere { $_.all ~~ UInt } #= Integer values to combine
){
say [+] @vals.combinations(2).map( { bit-diff( |@_ ) } );
}