🌉 bridged from @VegOwOtenks@lemmy.world by Tidepool
VegOwOtenks
@vegowotenks.lemmy.world.ap.tdpl.io
advent_of_code 🧸 - 2026 DAY 1 SOLUTIONS - 🧸
4 0Shell
Almost too easy, but I won't be doing shell for the upcoming days.
Part 1
sh
sed '/^$/d' input | sort | uniq -c | sort -d | tail -n 3 | cut -f 8 -d ' ' | paste -sd* | bc
Part 2
sh
sed '/^$/d' input | sort | uniq -c | sort -d | head -n 3 | cut -f 8 -d ' ' | paste -sd* | bc
advent_of_code 🧸 - 2026 DAY 1 SOLUTIONS - 🧸
1 0Thank you, I managed to resolve it by pasting the correct number x.x
advent_of_code 🧸 - 2026 DAY 1 SOLUTIONS - 🧸
2 0Thank you, I managed to resolve it by pasting the correct number x.x
advent_of_code 🧸 - 2026 DAY 1 SOLUTIONS - 🧸
2 0This is the compiled form, you write some human-readable strings and they are automatically transformed for brevity. You can try it on https://www.uiua.org/pad
advent_of_code 🧸 - 2026 DAY 1 SOLUTIONS - 🧸
2 2I would like to compare w/ solutions here but it seems like most cannot be run and require a framework.
advent_of_code 🧸 - 2026 DAY 1 SOLUTIONS - 🧸
1 0Sadly yes, for both parts.
advent_of_code 🧸 - 2026 DAY 1 SOLUTIONS - 🧸
3 1Haskell
haskell
module Main where import Data.List (sort, sortOn) import Data.Ord (Down(Down)) import Control.Arrow ((&&&)) import Data.List.NonEmpty (groupBy1) import qualified Data.List.NonEmpty as NE interactLn :: (String -> String) -> IO () interactLn f = interact f *> putStrLn "" main :: IO () main = interactLn $ show . (part1 &&& part2) . counts . sort . map read . init . lines mkPart f = product . map snd . take 3 . sortOn f part1, part2 :: [(Int, Int)] -> Int part1 = mkPart Down part2 = mkPart id counts :: Eq a => [a] -> [(Int, a)] counts = map (length &&& NE.head) . NE.group
Apparently, my part 2 is wrong? I double-checked with a second solution from here but it's the same result. I'd like to ask for help, but since I'm not allowed to share my input I'm a bit at a loss.
tenforward My brain translates "Red Alert" to "Enable Party Lighting"
1 0Makes me wonder, is there a Protoss mod for CNC:RA?
tenforward My brain translates "Red Alert" to "Enable Party Lighting"
1 0As soon as you go for it. I have added voice commands to a turn-based game once. It's perfectly doable with modern voice recognition toolsets and can run offline.
tenforward My brain translates "Red Alert" to "Enable Party Lighting"
2 0Ty, I added it
tenforward My brain translates "Red Alert" to "Enable Party Lighting"
1 0I'm out of the loop, played it like twice