Adventofcode.Com 2017 is live :)
Hello everyone,
From now till the 25th of december each day 2 programming problems to sharpen your programming skills.
Theme this year:
The night before Christmas, one of Santa's Elves calls you in a panic. "The printer's broken! We can't print the Naughty or Nice List!" By the time you make it to sub-basement 17, there are only a few minutes until midnight. "We have a big problem," she says; "there must be almost fifty bugs in this system, but nothing else can print The List. Stand in this square, quick! There's no time to explain; if you can convince them to pay you in stars, you'll be able to--" She pulls a lever and the world goes blurry.
When your eyes can focus again, everything seems a lot more pixelated than before. She must have sent you inside the computer! You check the system clock: 25 milliseconds until midnight. With that much time, you should be able to collect all fifty stars by December 25th.
Collect stars by solving puzzles. Two puzzles will be made available on each
daymillisecond in the advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants one star. Good luck!You're standing in a room with "digitization quarantine" written in LEDs along one wall. The only door is locked, but it includes a small interface. "Restricted Area - Strictly No Digitized Users Allowed."
It goes on to explain that you may only leave by solving a captcha to prove you're not a human. Apparently, you only get one millisecond to solve the captcha: too fast for a normal human, but it feels like hours to you.
If anybody wants to join this advent, we can use our own private leaderboard, with my code 130669-ab1f69bf.
I joined it :)
PS.: you can have multiple private leaderboards, in case you wonder.
Our team is growing
I'm in. Here's my solution.
Thought about using $zstrip, but while it can remove duplicates, it can't leave only duplicates:
Also, for second task it says:
Shouldn't 1221 produce 3 as first 2 and second 1 match.
Currently failed on second task with 10938.
I also started from $zstrip, but in task 1111 should produce 1, when $zstrip returns only one 1.
for the second task, you should simply compare values from the first half of string with the same position from the second half.
1212
1 -> 21
2 -> 12
1 -> 21
2 -> 12
No?
This is smart! )
I did part2 checking the whole length :/
Bert, thanks for sharing!
Here is my solution for Day1.
Join our leaderboard, too. ))
Already )
Share your solutions too ;)
My solutions are here: https://bitbucket.org/bertsarens/advent2017/
Should've done Day 3 part 1 same as you. Deriving the formula took me like half an hour.
Here's mine: https://github.com/eduard93/AOC/tree/master/AOC
My solutions will be here
My sollutions: https://bitbucket.org/ivo_ver_eecke/AoC2017/
Where is Danny when you need him? I guess he got a bit tired by doing 2016 one :)
Guessed right : found out that i still have a wife and two kids, ... bummer ;)
They will still be there on christmass :p
Darn it Bert, these things are addictive!
There's no way I'm getting up at 5am to even possibly get on the main leader board, but its fun to see how we all approach it.
I'll post mine up here....
https://gist.github.com/SeanConnelly/065cb51fc6572c6bf3dac4a9973fb54f
And maybe a few JavaScript ones as well if I get time...
https://gist.github.com/SeanConnelly/e0623e13241fd94fbf8df96b09755f95
Just for fun, one liners get an extra point - everyone rolls eyes :)
Day three part 2...
Not getting up at 5 am here either.
But seeing different solutions in cache is worth it.
I wonder, guys, how did you solve that the word is Anagram in Day4:
My solution is:
The full solution is here.
I implemented a simple hash function for it. I just created a new word from all the letters in alphabetical order.
If it's the same word. tadaaa. Code is found in my bitbucket above.
anagram used all letters, so I just compared lengths of strings and used $tr() to remove all characters from string one in another.
So, your code I would change like
This is beautiful! I like $tr!
But wrong )
E.g. it would not work for this example:
oiii ioii iioi iiio
it's not valid, but for your example would be valid.
I first translated each word into normalized form - array of [letter, number of occurrences], ordered by letters. And then just checked if given normalized form already exists:
Normalized words:
Oke,
The guys on the leaderboard are pretty insane.
I got up 2 mornings at 6am. (Thats when it starts for me.)
Started programming but being done and making no mistakes in 10 minutes or less to get on the leaderboard is just nuts.
Looks like we in the same timezone, and you solve tasks faster than me. When your time today was 15:47 minutes for the first task. But on the main Leaderboard fastest time 2:58. I really don't understand how it would be possible, to solve it so fast.
There are some videos on https://www.reddit.com/r/adventofcode/ doing speed runs.
They are mostly using python wich is very good at mapping functions to inputs.
some playlists below:
https://www.youtube.com/playlist?list=PLqhjTZS4RhCe-TMJlGvlXu7X_NmZaUtDe
https://www.youtube.com/watch?v=bCnTOC5l7TY&list=PLqLJjAz977SsDLGLmDx5sZcyD4JkmVxO0&index=2
Today's task was pretty difficult, it takes few hours to solve it. I made a mistake in first part even if I got the right answer, but after when I rewrote my first part, the second part was solved quite fast. But I lost so much time to figure it out.
I thought about actually building the tree in ppg and recursively iterating over it till the error is pinpointed. But it sure would take a lot of time to implement. What's your approach? Any shortcuts?
In the first implementation, I tried to actually build the tree. But missed something, and got some duplications in the lowest branches. Then using the same tree trying to solve second part, I found more than one unbalanced branches and a long time had not noticed how it could be until I noticed duplications. Then I removed this way, and first part becomes much simpler if just search node which does not have parents. In the second part, you actually already have a tree when you know when it started from the first part.
It is not that the task was so difficult, for me it was more that debugging it was very complicated.
That and understanding the assignment was not easy for me toady.
We decided to promote and support the contest, and launched a challenge on Global Masters:
We would track the private leaderboard with code: 130669-ab1f69bf. Join this private leaderboard, solve tasks with Caché ObjectScript be the leader in the end and get the endless fame plus 10,000 GM points!
2nd and 3rd places would get 5,000 and 3,000 points too.
Yes, there is some handicap for current members:
But we wouldn't change anything: we believe you have enough time and talent to beat them!
Let's have fun and let the COS power be with you! ;)
And, to join Global Masters just use your WRC creds on the login page, or leave a comment to this post, that you are participating in the contest, we would send you a special invite code.
Can you make it a requirement to share your code?
That way, we can learn something from other people and how they solve things.
I was planning on sharing my code at the end of the event, I think it is more fair that way
As soon as the number of points for the task depends on the time passed after task availability it’s relatively save to share it once you solved it.
So it’s OK to show up the repo after the marathon ends but of course I would only appreciate to see the discussions around nice solutions in COS.
That is fine for me.
The only thing that we will miss a bit is the dirty code in case you clean in it up. But I can live with that.
I learned a lot by watching the other repositories :)
Thought I might get the jump on at least one person above me on the board this morning, awake just an hour after day 9 started, all done in less than 9 mins, only to find all three have already been up and done it


I might have to start setting the alarm...
Hi, Bert!
You are right! The winner should show the public repository with solutions in Caché ObjectScript to be recognized as a winner.
But I think it’s OK to share solutions even now. I would only appreciate it.
You can find my code here. No time for clean-up, it's as messy as it can get.
https://github.com/Erich11/AoC2017
Jozef, Have you allready joined our intersytems private leaderboard? the code is: 130669-ab1f69bf
(you can join multiple btw if you are allready in a leaderboard)
Hi Bert, I'm already in as Daniel Reck (the successor of Josef Aßfalg)
My best result for the leaderboard was today:
And t hat means I am still only top 200. I was 4 minutes to slow.
How close have you guys come to top 100?
EDIT: I could have been 1 minute faster btw if I didnt submit the result of the test case as the first result. Waiting one minute doing nothing sucks.
My best day was a few days ago, but still very slow.
I'm usually much slower than you guys. Looks like you have more experience solving such tasks than me, you already solved both previous years.
Had to take a break between these two, but barely top 100 on the first - the second part was quite easy so if I hadn't taken a break, maybe I would have been able to get top 100 again
Great, Peter! Let's make top-50! ;)
The breaks are hard to deal with indeed. I have 1h tops and then I have to take care of the kids. After that I have to hope that I find some time at work.
I was 11 seconds faster on part 2 then you today dmitry. That was close.
I think I could have been faster if I didnt brute force it. Once you get a cycle I guess you can calculate where you should end up. I just did all 1B iterations :p
Social networks
InterSystems resources
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue