Well, we're off to a running start! Since the leaderboard is safely locked, we can go ahead and post our solutions now!
Day 1 - The Probl...
For further actions, you may consider blocking this person and/or reporting abuse
I would love to be part of some DEV leaderboards! I'm not showing myself as part of any right now, and am more than willing to use my own private one as a DEV-centric one if we need it. :) Do we have a way to share those so we can start joining?
I'll be doing my solutions in JavaScript - they're usually fairly verbose, since it helps me think better that way. lol :) So likely pretty beginner-friendly!
Here's day 1's solutions:
Ooh this is a great use of
do...while
. I went with the less elegant nestedif
for mine šPart 1 (JavaScript)
Part 2 (JavaScript)
Still works well! As long as it gets you the answer, it's good! :)
I saw someone use a ternary operator, and was super impressed. Might refactor mine later today to test that. :) Didn't even think of it!
Also, I couldn't resist the idea of the poem challenge they're doing on the subreddit, so I wrote an acrostic. :) Sharing here as well!
Very nice, I need to step my JS game up!
This post may help you regarding DEV leaderboards -
Want to Run DEV's Advent of Code?
Ryan Palo ć» Nov 11 ć» 1 min read
Post it here and I'll add it to the post and on further days posts! Go to you private leaderboard page and copy the code into a reply.
Alright, here's the code - 120635-5c140b9a.
We can make it for basically anyone on DEV, or we can focus it towards more beginner-friendly if we'd like - whatever works best for everyone!
Updated the post to include it! Thank you!
Awesome! Thanks for creating a leaderboard for DEV.
I'm in.
My kotlin solution.
I'm going to clean this up to avoid imperative style and post it as a reply to this comment.
github.com/jbristow/adventofcode/t...
This part 2 solution is much more elegant, and leverages monads.
I didn't even think about using a
max
function - that would have been so much cleaner than making two functions!I love cleaning these up into more elegant forms almost as much as I love just getting the solution banged out!
Solution in Clojure:
Yay, Advent of Code is back. I'm not going to stick to one programming language this year, in fact I'm going to try to use lots, even some I've not used before. I'm not quite hardcore enough to do the different-language-every-day challenge however. Not this year anyway.
Day 1 in Haskell:
Once it was solved I did it again in Python just for fun:
And in the spirit of what I wrote at the top, I did it once more in Julia, my first ever code in that language. First impressions very positive and interestingly it came out shortest. I love the built-in unit testing.
Hey folks - for anyone who's joined the leader board so far - I have a question!
So there are two main ways to sort our leader board, and I'm wondering which option would be best for us.
Option 1 - It counts how many people belong to the leader board (n), then the first user to get each star gets N points, the second gets N-1, and the last gets 1.
Option 2 - It counts how many stars you have, and then any ties are broken by the time you got the star. So if everyone gets all of the stars, the ones who get them the fastest are higher up.
I think either way is likely fine, but feel like maybe the star sort option might be best - it seems like it would encourage completion of the challenges more so than simply getting them done fastest, but still includes some speed needed to be higher up. Would love to hear some other thoughts on this, and whichever option seems most popular is what I'll sort it by!
I like option 2 a bit better. I'd rather see the people that manage to solve the more complicated problems at the top than those who solved the first few problems the fastest.
Same here, option 2 sounds better.
In the check for 5 digits or less.
My solution using Rust.
This was a good ramp into the month! Here's my Rust solution. :)
This is my solution to Part 1 in Ruby - working on Part 2!
I joined the leaderboard, but since I'm in a EU timezone and only have time to work on them in the evenings I'm expecting my scores to be quite low š
Here's my solution for day 1 with Python (explained my thinking behind it here):
Part 1:
Part 2:
Bit late to the party!
Here is my solution in swift. Incase anyone would like followup code can be found here in Github
Elixir way
Day 01
I'm also participating this year. I want to solve everything in JS, as I'm new to web development (mostly frontend with React) on my job, too.
gitlab.com/xgyrosx/adventofcode
Part1
Part2
It took my quiet some time, especially for the file IO as there are so many approaches.
Day 1, always good to start nice and easy!
Solution for part two:
And here is part one
I wrote my day 1 up here:
Day 1
Written in Clojure
Here is my solution in JavaScript:
The Private Leaderboard page seems to be pointing to 2018.
Fixed! Thank you!