Last active
December 2, 2020 15:59
-
-
Save xpqz/e455740b14338a43ad226603e3b1e437 to your computer and use it in GitHub Desktop.
Ungolfed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DAY02←⍎¨@1 2¨'- :'∘segs¨⊃⎕NGET'data/2020/day02.txt'1 | |
Part1←{ | |
(min max letter string)←⍵ | |
count←+/letter=string | |
(min∘≤∧≤∘max) count | |
} | |
Part2←{ | |
(min max letter string)←⍵ ⍝ De-structure | |
⊃(letter=min⊃string)≠(letter=max⊃string) ⍝ Pick the values, and XOR | |
} | |
+/Part1¨DAY02 | |
+/Part2¨DAY02 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment