Forum menu
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.
First 12 done. Meetings all day today so not even started 13. Might get a chance lunch tomorrow.
It seems easier than last year so far. Only one that’s needed anything really fixed to get from part 1 to 2. Last year there were a few in the first week where you needed to change your algorithm completely to keep the numbers sane.
13 was way easier than 12 imo. Just getting through it step by step. Anyone fancy an stw leaderboard?
Ok stw leaderboard code is 2114560-90631d35
URL is https://adventofcode.com/2022/leaderboard/private/view/2114560
It seems easier than last year so far.
Yeah, I thought so too. I wondered if it was just because I was more familiar with the style of puzzle.
13 was way easier than 12 imo.
13 had a sneaky case that wasn't covered by the example that caught me out for a couple of minutes, I found 12 fairly straightforward (but we had a pretty similar puzzle last year, and I could remember how I solved it).
todays was quite enjoyable, I had a bug in my line drawing which meant it wasn't working quite right, drawing out the grid is quite satisfying for debug purposes
I thought today's was pretty dull, tbh. Didn't really have to think and could just tap out a solution.
Caught up now - 13 was a bit messy. 14 was kind of fun but a lot simpler (and I'm sure there's a nicer way to do it than my brute-force way - but I still solved in well under a second.
13 was messy but Part 2 was a doddle by sheer luck - I solved part 1
Longest for me so far was day 9 - ropes. Really annoying - all the logic was right but I was only reading one digit of the movement counter.. R 19 was parsing as R 1. Careless mistake but took ages to work it out.
yeah I did day 13 the same way as you (albeit in kotlin) so the second part took all of 1 minute to complete..
I stumbled a bit on the second part of the knots one too - turns out actually slowing down and reading the text helps sometimes.
Probably the one that's caught me out for the longest was the second part of day 11.
I was lucky with that one (path finding, wasn’t it?). It was one line of code for me - just had to set everything with height “a” to be reachable in 0 steps. That was a relief as I had to get back to work 😂
11 was the divide by 3 one (turns out that neither longs nor bigints were the answer), path finding one was easy after last year
Did day one earlier in a bit of downtime.
Biggest takeaways for me is how easy vscode web and GitHub codespaces are..
urgh part 2 of todays is Tough. took a lot of rework to get mine to perform reasonably (runs in <10s in the end)
Yeah. Took me a while to devise a reasonable algorithm too. Runs in about 2s - could probably shave some off, but that'll do.
2s is fast - what approach did you use?
How do I do spoiler blocks?
I was tying myself in knots today trying to get a clever way to solve part 2. I think I was on the track to doing something nice and fast with overlapping diamonds but in the end I decided to see how long the brute force would take. Ended up being 19s so I'll just take that at the moment. Attack again when I have some time to spare.
Spoiler blocks - put [ then word "spoiler" then ] - close it with [ \ same word ]
Make that 8s on the brute-force method (minor tweaks and realised I was running with Java 8 not 19 - good performance increase). Time to leave the computer, I think.
Ah, I'd been trying with lt/gt tags - like all the other ones.
I basically had an efficient brute force.
Sort the sensors by descending Manhattan number.
Iterate over all the valid values of Y:
Start with a set of intervals [[0,4e6]]
For each sensor; calculate the min, max values of X for the given Y
Subtract this interval from the set of possible X values (e.g. [[0,100]] - [10,20] => [[0,9],[21,100]])
If the set of intervals becomes empty, shortcut to the next Y value
If we reach the end of the sensors, and the set is non-empty, then that's the answer.