1 2 3 4 5 6 7
sub MAIN( *@n where *.elems > 0 ) { say [+] @n.combinations( 2 ).map: -> ( Int $a, Int $b ) { ( $a +^ $b ).base( 2 ).indices( 1 ) } }