diff options
| author | Simon Proctor <simon.proctor@zoopla.co.uk> | 2020-09-21 09:21:22 +0100 |
|---|---|---|
| committer | Simon Proctor <simon.proctor@zoopla.co.uk> | 2020-09-21 09:21:22 +0100 |
| commit | 035364d2ca9ca93bc276349c47fbd1fc4fb1e683 (patch) | |
| tree | 3d6267ff2c4213abc6077c31e774eefdef55405b | |
| parent | 5ac16ac7e9826137e0da5597e954f4992c66205d (diff) | |
| download | perlweeklychallenge-club-035364d2ca9ca93bc276349c47fbd1fc4fb1e683.tar.gz perlweeklychallenge-club-035364d2ca9ca93bc276349c47fbd1fc4fb1e683.tar.bz2 perlweeklychallenge-club-035364d2ca9ca93bc276349c47fbd1fc4fb1e683.zip | |
Challenge 1
| -rw-r--r-- | challenge-079/simon-proctor/raku/ch-1.raku | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/challenge-079/simon-proctor/raku/ch-1.raku b/challenge-079/simon-proctor/raku/ch-1.raku new file mode 100644 index 0000000000..4555876047 --- /dev/null +++ b/challenge-079/simon-proctor/raku/ch-1.raku @@ -0,0 +1,10 @@ +#!/usr/bin/env raku + +use v6; + +#| Count the total numbrer of set bits of the binary representations of all numbers from 1 to $N and return $total_count_set_bit % 1000000007 +sub MAIN ( + UInt $N #= Max number to count up to +) { + say ( [+] (1..$N).race.map( *.base(2).comb ).flat ) % 1000000007 +} |
