Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: Advent of Code, Day 15, golfed!

by Jasper (Chaplain)
on Dec 19, 2021 at 04:39 UTC ( [id://11139715]=note: print w/replies, xml ) Need Help??


in reply to Re: Advent of Code, Day 15, golfed!
in thread Advent of Code, Day 15, golfed!

Combining that with another stroke saved by replacing the stupid ++$g, $g-1 stuff
push@a,/./g}{print$s{-1+map{$u{$_}||=$a[$_]+$s{$g}for grep$a[$_]*!$s{$_},$g+$.,$g-($g%$.>0),$g-$.*($g>=$.),$g+($g%$. <$.-1);($g)=sort{$u{$a}-$u{$b}}keys%u;$s{$g}=delete$u{$g}}@a}

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11139715]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-06-22 15:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.