You don't need to be an 'investor' to invest in Singletrack: 6 days left: 95% of target - Find out more
Doing this kind of thing in what I imagine FME to be sounds horrible
Yesterday's was really straightforward in FME as it was essentially a spatial problem and FME was initially developed as a tool for spatial data.
E.g. part two I just had to create a grid, discard the squares with 9 and dissolve the remaining squares together. The dissolve transformer helpfully keeps a count of all dissolved polygons, so then just keep the largest 3

Coming to this a bit late but just written my first ever Python program for the day 1 challenge and I'm impressed with PyCharm IDE. My very first program was written in Basic under the George 3 operating system on a remote teletype with the program stored on punch paper tape. Those were the days!
I prefer spyder. And more recently VS code
Hoping to have some time this weekend to catch up, have chosen to try VS Code (vim for the win normally).
Finding a new editor heavier going than I would hope, am I so slow with it, and I haven't got the perl debugger working either, so there is no advantage !.
Looks like VS code runs on Mac so will take a look.
Spyder is great for datasciencey type stuff. I tend to use it when I’m developing an algorithm or similar as it’s real easy to step in and out, explore variables/arrays etc and graph as you go.
Not managed the last two days in vanilla FME thus far, have had to resort to using PythonCallers. Day 11 I'm pretty sure is possible, not sure about Day 12.
Glad to have something a bit easier in FME for Day 13.
I found 13 quite satisfying and enjoyable, though it didn't require too much thought (probably for the best in my case!).
It was quite satisfying to see intelligible letters appearing at the end :).
Especially after I misread the first part - well ignored the bit in bold - and was running to completion and not just the first step. Confused me as I was sure my code _should_ have been doing the right thing.
Spent all day talking about log4j for some reason
I did d13 - yes a good ending to that one - not sure I'll get time to go back to 11 and 12 as it's going to be busy this week
...
Day 14 was another quick one. Quite liked it but you could pretty much guess where part 2 was going to head..
I've just got round to Day 6 - lanternfish. I assume it's going to need some kind of clever coding to cater for part 2 to not make my laptop go pop?
using namespace System.Collections.Generic
$newlist = [List[int]]@()
$myList = [List[int]]@()
[int[]]$new
$lanternfish = Get-Content .\Day6.txt
$lanternfish.Split(",") | ForEach {
$mylist.add($_ )
}
for ( $i = 0 ; $i -lt 80 ; $i ++ ) {
$mylist | foreach {
If ($_ -gt 0 ) {
$new = $_
$new --
$newlist.add($new)
}
ElseIF ($_ -eq 0) {
$newlist.add(8)
$newlist.add(6)
}
}
$mylist = $newlist
$newlist = [List[int]]@()
}
$mylist.Count
I assume it’s going to need some kind of clever coding to cater for part 2 to not make my laptop go pop?
Yep.
Not got d14p2 yet. Yes, knew what was coming based on the use of the phrase 'This polymer grows quickly' in the description, but can't see a way to do it yet
If you want a hint...
The way I did it - there may well be better - I just kept track of the number of each pair. You don't need to know the order. You do, however need the first and last letter.
Then each generation - each Pair - for example NN becomes the same number of the two new pairs.
After all your generations - add how many of each letter you have, add the end ones, then divide by 2 to get the actual numbers (pairs double count all the letters except the end ones - but you've added those).
Now you have a (in my case) Map N -> 1234, C -> 4321, etc.
Edit - reading that, not sure it makes much sense.
If you want a hint…
I'm not sure that's a hint, so much as a spoiler.
I'm just catching up - spent FAR TO LONG on the second half of day 12.
I was getting all the right answers for the test cases, but the wrong final answer for the real test data, which was a bit miffy as that was the first wrong answer submitted.
Spent half an hour looking at the code changes for p2 which were about 5 lines, only to find the true problem was a single line route length sanity check right out of the way I put in last night when I started it and mocked up the recursive search function, and the p2 changes made routes much longer than that, but all the test data was fine.
Doh. On to day 13.
I’ve just got round to Day 6 – lanternfish. I assume it’s going to need some kind of clever coding to cater for part 2 to not make my laptop go pop?
Don't think about fish, think about where they go to learn.
You lot are clearly geeks, you'll know - Javascript, what's the best way to learn it, good beginner resources etc?
Any answer that starts with "ignore it and learn "x" instead will be given a good stiff ignoring, it's JS or nowt apparently.
Do you know any other programming languages?
And, what do you need to learn JS to do? Most of the interesting JS is using some kind of framework - you probably want to start from the right one.
Nope, complete beginner.
No idea why, it's just something they've been told they could do with learning for work. Yes, it's a very vague requirement!
I'm sure there must be a cleverer way of doing Part 2 today, but I just made a coffee whilst my workspace was running instead 🙂
@LLama - Thanks for that - it looks like it should do the job, I might even have a go myself.
I’m sure there must be a cleverer way of doing Part 2 today, but I just made a coffee whilst my workspace was running instead 🙂
I'm not even sure how to do part 1 in a reasonable amount of time
That took longer than I'd be happy telling my boss!
I'm not sure there's a quick way to search all the possibilities. I managed to get part 1 down to <1s but part 2 was about a minute to run (2019 MacBook with an i9).
Is there a clever way to do it so that it's not just crunching away?
Devised a reasonably efficient way of solving part 1, finally.
... and it only took a couple of seconds to execute for part 2, which was nice.
Huh, I'd not actually seen the common algorithm used to solve the problem before.
I'm reasonably impressed with myself that I managed to invent it for myself relatively quickly.
@euain - RGlqa3N0cmE= (base64 encoded)
My input grid is sufficiently large that I can't work out how you get a solution for part 1 that doesn't scale linearly for part 2.
Thanks - will have a play. 🙂
Happy to share my non-optimal solution if interested but I'm pretty sure this is going to be much better.
Happy to share my non-optimal solution if interested but I’m pretty sure this is going to be much better.
Yeah, if you wouldn't mind.
My initial approach was to try to brute force every possible route, which worked okay for the sample set, but failed pretty miserably for the input. Tried a few approaches around making that more efficient, but it was fairly obvious that there were just too many permutations at that scale for it to ever fly.
I've not attempted today's in just FME yet, I've completed it with FME/Python, I'm pretty sure part 1 is possible but I'm not sure I can be bothered as it will be a pain! Too much hard work understanding the puzzle today rather than actually solving it
It was a bit of a slog to work out what they were wanting. Nice wee recursive function at the end which was satisfying to see work.
Fiddly one today. I still haven't gotten part 2.
Passes the examples, and the first few params look okay (after decoding by hand), but I'm not getting the right answer :/
Oh, I missed the stupid prefix
Today was easy enough. Carried on with a slow brute-force solution (45s to solve) to part 2 but rejigged for 0.4s :).
Yeah, I just brute forced today. Wasn't proud of it.
had to put on hold now due to trying to get the stuff I'm paid for done in time for hols
might give todays a shot later
Mid dog-walk, worked out how to do part 1 with pen and paper (and managed to prove to myself there couldn't be any higher values of height that I hadn't reached). 14ms for the solution to b now :).
Finished Day 6Pt2 Lanternfish. Quite simple in the end but again, techie code issues muddied the water. Getting better tho.
Fiddly one today. Not really difficult, just some annoying code to write.
At least part 2 was trivial.
Yup, that sums it up. A bit of a slog on this one - and I managed to mess up the "get the number to the right of this one" stuff in a way I didn't spot for a while (trying to be too clever).
The folding one is still my favourite so far. (Or yesterday's one about launching drones but that's just because I managed to work out the first bit with a pen, paper and calculator - and that was being lazy).
Gosh, today's was hard work.
Today's was a bit sneaky, but went okay.
Found Sunday's bloody hard work. Plenty of chance to get thoroughly confused for me.
Relief that today's was a lot easier - though I was disappointed I didn't get a nice picture out at the end. (Or maybe I should have and my output isn't working properly?). Not sure about sneaky - they repeated "it's infinite" a few times but took a wee bit of head scratching.
Properly confused by part 2 today
Worked it out, that required a lot of thinking.
Agreed - took a bit of thinking about and my clever shortcut didn't work at all and I had to start again.
Then I was getting the wrong answer and thought it should be right. Parked it to do some proper work. Fresh eyes found I'd managed to overtype something and put a bug in my code that works out the position when you add the dice roll to your current position. Step 1 was fine - step 2 was never returning position 10. Doh..
Annoying today - mine was just about working but numbers were slightly off. In a messy bit of code I was checking a "xmin" instead of "zmin" - so my cuboids weren't as they should be! OK after that.
I really can't seem to get today's to work, I'm doing something weird with calculating a compound sum, I think.
I'm playing catchup as busy over the weekend but now away on holiday and it's peeing it down so it's keeping me occupied
I think mine's pretty solid for today so happy to supply alternate test cases / debugging scenarios if that helps.
Cheers! It's not the test cases I'm stuck on though, I'm failing at something something nested intersecting cubes.
Got it, finally. Had to have a small hint to think about it differently.
Just did part 1 on paper today, can't see a solution for part 2 yet, let alone the lowest cost solution.
@euain - if you end up with some code to do part 2, and wouldn't mind checking my input, I'd appreciate it. I'm really not seeing *any* solution for it.
never mind - got it.
... but there can't be more than one solution...
Not had a chance to attack it today. Not quite sure how I’m going to go about this. Hopefully get some time tomorrow.
I think I've got a solution that will work, just need to add scoring to it.
It's *absurd*, though.
Amphipod one worked OK. My solution wasn't too clever but both parts solve in <1s (I think mainly because it's just an small-ish integer array) so I'll take that. Sheer luck meant I just had minor changes between pt 1 and 2.
Today's took longer than it should have
Still to do more than have a wee look over that one. I wonder how long a brute-force approach is going to take on that :).
Nice fast one today
I’ve got a geeky few hours booked in for Boxing Day. Still got 24 and 25 to do.
Not a fan of Day24, wasted a load of time creating my Arithmetic Logic Unit then had to go in a totally different direction.
Day25 nice and straightforward, still short 8 stars
And suddenly it's time for AoC 2022.
Nice gentle introduction today. Anyone else started?
I'm still having nightmares from last year.
First time for me this year. So far so good...
Bit busier this year, have to do them in dribs and drabs
Never seen this before.
Never seen this before, but just solved the first day with excel, is that cheating? (There wasn’t an RPGIV editor on replit.com, so I’m a bit stuffed otherwise).
RPG ? I haven’t written any RPG in anger for over a decade, probably longer. Let me dig out that old as/400 I have in the loft….
I'm in again this year
There are two hard things in computer science: cache invalidation, naming things, and off-by-one errors.
— Jeff Atwood (@codinghorror) August 31, 2014
Never seen that before, but spot on. Although you could add reucursion..
First time for me this year. So far so good…
If it's like last year, you can knock the first 10 days or so out without thinking too hard, but after that they get steadily trickier, and the last week is not easy (average/good sw bod with 30 years experience)
Took me 20 minutes to remember how to convert text files into DB2 tables, so not holding out too much hope for me being able to do this in a timely manner 🙂
Will have a crack at lunchtime…
How's everyone doing so far?
I'm halfway through day 1.