From eeb3633702484e3c05a17d6326fc6dd8ce01481b Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Mon, 11 Dec 2023 12:42:38 -0800 Subject: [PATCH] [2023][uiua][11.x] shortening --- 2023/uiua/day_11.ua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/2023/uiua/day_11.ua b/2023/uiua/day_11.ua index 222fec9..3c5f24e 100644 --- a/2023/uiua/day_11.ua +++ b/2023/uiua/day_11.ua @@ -1,10 +1,10 @@ MappedIndices ← +⊃(\+×≡/×=@.)(⇡⧻): -1 Input ← &fras "../day_11.txt" -⊜∘≠, @\n Input # split on newlines -↯¯1_2⊞⊂ ∩(MappedIndices 1000000) ⊃∘⍉ # map indices -=@#▽≠@\n. Input # find galaxies -▽ # keep galaxies -↯¯1_2_2⊠⊟. # galaxy pairs -/+≡(/+⌵-°⊟) # distances -÷2 # account for reversed pairs +⊜∘≠, @\n Input # split on newlines +↯¯1_2⊞⊂ ∩(MappedIndices 1000000) ⊃∘⍉ . # mapped indices +▽=@#♭: # galaxy indices +↯¯1_2_2⊠⊟. # pairs of galaxies +⊝≡(⊏⍏.) # unique pairs +≡(/+⌵-°⊟) # distances between pairs +/+ # sum