AoC 2023, day 6

Run Settings
LanguageRaku
Language Version
Run Command
sub win-count($time, $dist) { my $a = sqrt(($time² / 4) - $dist); ($time / 2 + $a - 1).ceiling - ($time / 2 - $a + 1).floor + 1 } my ($times, $dists) = $*IN.lines.map(*.comb(/\d+/).Array); put 'part 1: ', [*] (@$times Z @$dists).map({ win-count(.[0], .[1]) }); put 'part 2: ', win-count($times.join, $dists.join);
Editor Settings
Theme
Key bindings
Full width
Lines