Skip to content

Commit 2151883

Browse files
committed
Handle more than one leading zero bit
1 parent 22ad6fa commit 2151883

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

2021/day16/day16.raku

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Solver {
1515
has Str $.input is required;
1616
has @.binary = $!input.chomp.parse-base(16).base(2).comb;
1717

18-
submethod TWEAK { @!binary.unshift(0) if $!input.substr(0, 1) lt '8' }
18+
submethod TWEAK { @!binary.prepend(0 xx $!input.chomp.chars * 4 - +@!binary) }
1919

2020
method parse-and-eval( --> List) {
2121
my $version-sum = 0;

0 commit comments

Comments
 (0)