this post was submitted on 01 Dec 2024
2 points (100.0% liked)

Advent of Code

293 readers
1 users here now

Advent of Code is an annual Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.

https://adventofcode.com

founded 2 years ago
MODERATORS
 

Feel free to share your solutions or browse others' for inspiration! Please tag your comments with the language you solved in to make it easier to search for specific languages in case we happen to get more comments than expected. πŸ˜€ I really hope that we can create some discussion here to liven up this community!

you are viewing a single comment's thread
view the rest of the comments
[–] mykl@lemmy.world 1 points 5 months ago

For entertainment purposes only, I'll be trying a solution in Uiua each day until it all gets too much for me...

$ 4   3
$ 2   5
$ 1   3
$ 3   9
$ 3   3
βŠœβˆ˜βŠΈβ‰ @\n     # Partition at \n.
⊜(β†βˆ΅β‹•)βŠΈβ‰ @\s # Partition at space, parse ints, sort.
/+/(⌡-)     # Get abs differences, sum.