- Видео 93
- Просмотров 304 403
HyperNeutrino
Канада
Добавлен 4 янв 2018
[she/her 🏳️⚧️ 🇨🇦] 22-y/o BCS 2025, hobbies are music, programming, and gaming.
Advent of Code 2024 | Day 25 "Code Chronicle"
Sign up for CodeCrafters: app.codecrafters.io/join?via=hyper-neutrino
Join the Discord Server: discord.gg/j9uunTRRJm
Join the Discord Server: discord.gg/j9uunTRRJm
Просмотров: 1 490
Видео
Advent of Code 2024 | Day 24 "Crossed Wires"
Просмотров 3,6 тыс.Месяц назад
0:00 Part 1 11:52 Part 2 Strategy 51:20 Part 2 Generalization
Advent of Code 2024 | Day 22 "Monkey Market"
Просмотров 1,8 тыс.Месяц назад
0:00 Part 1 7:17 Part 2 16:37 Optimizing Part 2 (barely) 21:45 Trying to Optimize Part 1 (pointless rambling about bitwise arithmetic)
Advent of Code 2024 | Day 21 "Keypad Conundrum"
Просмотров 4,4 тыс.Месяц назад
0:00 Part 1 32:30 Part 2
Advent of Code 2024 | Day 20 "Race Condition"
Просмотров 2,9 тыс.Месяц назад
app.codecrafters.io/join?via=hyper-neutrino 0:00 Part 1 14:04 Sponsored Giveaway 16:13 Part 2
Advent of Code 2024 | Day 17 "Chronospatial Computer"
Просмотров 5 тыс.Месяц назад
0:00 Part 1 16:54 Part 2 Partial Hand-Solving 35:58 Part 2 Full Solve
Advent of Code 2024 | Day 16 "Reindeer Maze"
Просмотров 4 тыс.Месяц назад
0:00 Part 1 12:33 Part 2 28:40 Recap
Advent of Code 2024 | Day 15 "Warehouse Woes"
Просмотров 3 тыс.Месяц назад
app.codecrafters.io/join?via=hyper-neutrino 0:00 Part 1 10:00 CodeCrafters Sponsor Segment 11:50 Part 2
Advent of Code 2024 | Day 14 "Restroom Redoubt"
Просмотров 3,4 тыс.Месяц назад
0:00 Part 1 7:46 Rambling about how much I dislike part 2 9:05 Part 2
Advent of Code 2024 | Day 13 "Claw Contraption"
Просмотров 4,1 тыс.Месяц назад
0:00 Inefficient Part 1 3:56 Optimizations for Part 2 (Lots of Math) 13:37 Efficient Implementation 15:54 Part 2
Advent of Code 2024 | Day 12 "Garden Groups"
Просмотров 4,7 тыс.Месяц назад
app.codecrafters.io/join?via=hyper-neutrino 0:00 Part 1 9:33 CodeCrafters Sponsor Segment 11:22 Part 2 27:00 Alternative Part 2
Advent of Code 2024 | Day 11 "Plutonian Pebbles"
Просмотров 4 тыс.Месяц назад
Advent of Code 2024 | Day 11 "Plutonian Pebbles"
Advent of Code 2024 | Day 10 "Hoof It"
Просмотров 2,3 тыс.Месяц назад
Advent of Code 2024 | Day 10 "Hoof It"
Advent of Code 2024 | Day 09 "Disk Fragmenter"
Просмотров 3,8 тыс.Месяц назад
Advent of Code 2024 | Day 09 "Disk Fragmenter"
Advent of Code 2024 | Day 08 "Resonant Collinearity"
Просмотров 3,2 тыс.Месяц назад
Advent of Code 2024 | Day 08 "Resonant Collinearity"
Advent of Code 2024 | Day 07 "Bridge Repair"
Просмотров 2,4 тыс.Месяц назад
Advent of Code 2024 | Day 07 "Bridge Repair"
Advent of Code 2024 | Day 06 "Guard Gallivant"
Просмотров 3,3 тыс.Месяц назад
Advent of Code 2024 | Day 06 "Guard Gallivant"
Advent of Code 2024 | Day 05 "Print Queue"
Просмотров 3,6 тыс.Месяц назад
Advent of Code 2024 | Day 05 "Print Queue"
Advent of Code 2024 | Day 04 "Ceres Search"
Просмотров 4,5 тыс.2 месяца назад
Advent of Code 2024 | Day 04 "Ceres Search"
Advent of Code 2024 | Day 03 "Mull It Over"
Просмотров 2 тыс.2 месяца назад
Advent of Code 2024 | Day 03 "Mull It Over"
Advent of Code 2024 | Day 02 "Red-Nosed Reports"
Просмотров 3,4 тыс.2 месяца назад
Advent of Code 2024 | Day 02 "Red-Nosed Reports"
Advent of Code 2024 | Day 01 "Historian Hysteria"
Просмотров 3,3 тыс.2 месяца назад
Advent of Code 2024 | Day 01 "Historian Hysteria"
International Transgender Day of Remembrance
Просмотров 5772 месяца назад
International Transgender Day of Remembrance
"Can I follow this recipe?" | Code Golf Problem
Просмотров 80310 месяцев назад
"Can I follow this recipe?" | Code Golf Problem
Advent of Code 2023 Day 25: Snowverload
Просмотров 3,4 тыс.Год назад
Advent of Code 2023 Day 25: Snowverload
Can't thank you enough for explaining the why and how of your solution. Really helped me understand what was going on, much appreciated.
each second produces a map, so I coded a solution where I'd create a grid and then check for symmetry by scoring left and right side, obv I didn't find anything because it wasn't in the middle, so I had to sweep every map... then I find out that it could've been this easy... lol
Could you share your ide font family name?😬🙏
I really liked this problem because it allows several very interesting optimizations, my favorite being to directly convert all keys and locks to bitmaps, including the newlines: 32 bits covers the final char on the starting line, plus a newline plus 5 lines of 5 chars+newline. This can be done with a single unaligned load of 32 bytes into an AVX register, followed by a parallel compare to 32 x '#' which results in 32 bytes of either 0xff or 0. Convert this to a 32-bit bitmask with the instruction that extracts all the sign bits. After loading all 250+250 keys and locks, the testing for matches can then be done 8 x in parallel. On my 4.5 year old laptop this runs in 8.2 microseconds for all the 62500 tests, all in safe Rust thanks to the clang auto-vectorizer! 🙂
This is the first year that I was able to finish - hopefully one year I can finish all of them the day they release. I find your explanations informative and will be tuned in next year!
Thanks so much, I could never solve this on my own.
Thank you so much, I couldn't have made it to the end without you. I love your explanations and thinking process.
How are you seem to be so unaffected by cognitive load? Your explanation is so concentrated and enjoyable. Not a single redundant word.
once again a very detailed video - thanks! Considering direction as part of the state is clever. for 2nd part, given the backtrack's are acyclic and seen is a set would it be good enough if the fill only stores the position (r,c) in seen (and doesn't worry about duplicates) ?
Your mind is so fast, hopefully with enough practice, I will get there ! I just solved it today, and learned the word Clique doing so. Keep up the good work ! Thank you
You made it look so easy. I was stuck in part1.
Curious why the sample problem doesn't seem to work with the 'full solution'?
The best thing I learned from the video is the analysis part where the author print, with indentation, how a znn value is calculated. Thanks a lot for sharing!
I had been stuck on this for eeeever. Thank you so much for explaining! Why is the pointer in part two only moving until position 12 instead of position 14, which would be the regular end of the program?
for part 1 I solved this using dynamic programming with no recursion and a trie.. placed the towels in a trie and then search for each design slice within the trie if I found 1 combination then I would break since no more were needed.. so basically my dp array was storing booleans.. for part 2 I removed the early break since we actually care about all combinations and then instead of a dp array that stores booleans this I would store integers and them kept summing the up as combinations were found. it was pretty fast
I used matplotlib to make actual images, and plotted a few iterations, just to get a feel of what I might encounter. I noticed that the size of the field is given by prime numbers, and in the first 100 iterations I noticed a regular pattern, a band of aligned robots. I then used the field-size to take bigger steps, and found the solution quite quickly. For matplotlib I already stored the field in a bumpy array. I used the gzip module to compress the bytes-array representation of the image, figuring that the Christmas tree would be the field with the lowest entropy, and therefore resulting in the smallest compressed size. This returned the same answer. Having seen the image, the reason your solution works is probably because it is located on the vertical axis, cutting out a fair number of robots in the middle, lowering the safety factor. I think it was located towards the top of the field, but I think you got a little bit lucky here.
It worked for me.
I'm too late for the recap stream as I'm still catching up on the final aoc days. What I did (before I got stuck on what to do next) for part 2 was XOR-ing the result I got from part 1 with the result that an actual sum of the bits in x and the bits in y would be. I guess you could do that instead of your progress function. The least significant bit of that xor result that is 1 (non zero) should be the next gate to look at to swap? Edit: My wording isn't perfect, but what I mean is that that bit's position should denote which z-bit to look at. So if your XOR result is something like 0011010100 you should look at z02 first.
I don't understand part2 of the solution. You didn't explain it well.
my answer for part 1 and 2 were exactly as yours "737", "1619" maybe we got the same seed :D wondering how many unique seeds there are for each task
Excellent explanation for part 2. I ended up following mostly along but hand solving my own input to get that part worked out and felt like I learned something very cool. Thank you for making these!
Are there common places where you can post code for AOC asking for help? I did a A* search with backtracking and my code works for all the test cases but not for input data. Not sure what edge case my code is missing and I've spent entirely too many hours trying to figure out, lol.
Hey Hyper, really enjoying your content! How did you manage to learn a lot of these concepts to do these questions quickly? Thank you :)
Hello, I really appreciated following your videos / explanations about the Advent Of Code 2024 challenge. Thank you for your work and have a wonderful end of year ! Cheers from France (Brest)
Thank you, you're the best! bye, hope to see you next year!!
Absolutely fantastic videos, you have a talent for explaining concepts, thanks. I'll definitely watch more as I work through a few more of these problems belatedly. I got stuck on part B here. And for my input the find the minimum safety factor did not work! As was also my first guess.. I had to do some longest stretch of adjacent spaces with robot heuristic to find it. Conversely, I actually really liked part B, maybe because of the unknown factor in what the pattern you're looking for is.. your criticisms are legit tho, of course.
Handle: Canguy247 I love Advent of Code because it is an opportunity to learn a new language and has a community element to it
🙏Thanks for all your concise explanations (waive day 24 part 2😊). And congrats to a finishing place on the global leaderboard👍
part 1: I converted the gate types into a 4-bit binary truth table (XOR=6, AND=8, OR=14) so I could generalize calculation without lambdas (because C), but otherwise very similar to yours. part 2: If you look up "full adder" on wikipedia you get the standard circuits for a cascade-carry adder, implemented with AND/OR/XOR, which is what they've used for this puzzle (I checked by counting the gates, 89 XORs, 89 ANDs, 44 ORs, as it would be for this circuit). It can help to see the layout of the logic laid out logically. You can think of it as a half-adder (XOR→out, AND→carry) adding the two input bits, then another half-adder adding the carry input from the previous bit to the result from the first adder, then an OR gate combining the carries. This results in an XOR combining the two inputs, an AND also combining the two inputs, an XOR outputting to the output for that same bit which combines the output from the first XOR with the carry from the previous bit, an AND that combines the same 2 wires as the second XOR, and finally an OR that combines the outputs from the two ANDs and connects to the following bits carry in.. Due to how the question is formed, ONLY OUTPUT WIRES CAN BE WRONG. This means that all the XORs and ANDs that connect to the inputs are known what their roles are, and CANNOT correctly connect to output wires, except the first bit (x00^y00→z00) which only has a half-adder. Similarly, output wires should ONLY be supplied by XORs, except the top bit which has the OR from the last carry. Every XOR should have a parallel AND that has the same inputs, and all ANDs should connect to an OR that in turn connects to the next bit along. I tried a few different ways to auto-check for these connections but they couldn't find all the errors (3 out of 4 though). In the end the much simpler way was to put in simple inputs, process them, and look at the errors in the outputs: in my case I put in 1-bit numbers in powers of 2: first same numbers, then adjacent bits, then one with 2 adjacent bits and one with one to cause a carry. This made it obvious where in the 44 bit adder the errors were, what kind of miss-connection it was likely to be, and made it possible to find them by close examination of the input file by eye. I then made a fresh copy of the input with the errors corrected and tested it. not quick, or generalizable, but I got an answer eventually...
based on your Inspiration, I did it via this logic and got the answer within 0.1s. if not Z: swap(M, N); break if Z != zi: swap(Z, zi); break # M (intermediate sum) # N (intermediate carry) # Z (final sum) # zi=current z
Great work! Thanks for the explanation
Part 2 was wild, even with your great explanation it still took me far too long to understand it and write a solution
This was a great series. Thanks for helping us through it! I would love to see another pass at day 21 if you get around to it :D
Thank your for your explanations and helping me through this year too!
I battled forever before coming here. I read "For these larger boxes, distances are measured from the edge of the map to the closest edge of the box in question." as calculating left edge of map to left edge of box and right edge of map to right edge of map then taking the minimum of that. I see you just calculated left map to left edge. When I did same, I finally hit it. I was going insane.
Thank you for your videos! Helped me a lot when I got stuck on some problems
Thank you so much, when you said for the last operand a must be between 0 and 7 otherwise it would keep printing I hit my head against the desk. Trying to do it low to high was such a frustrating search problem to attempt to write
thank you so much for making these videos ❤
Thank you very much for your videos. They provided me the insights I needed to complete the AoC 2024 in Haskell.
Thank you for your videos! Well explained! :)
Phew, this was a tough one. I also did a semi-manual solution, like so: Since we knew it was an adder I tested each pair of x and y input bits separately. Starting at the least significant bits x00 and y00 I feed the values 00, 01, 10 and 11 into them, and compared that with the expected z value sequence: 0, 1, 1, 0. If the output matches this, continue to the next bit, and do the same for x01 and y01, checking z01, etc. The interesting part is this: if the expected result does not match the current output z, look at the output patterns for all other gates instead. If any of them have the 0, 1, 1, 0 pattern, they could be a replacement. For the example of part 2 (which is not an adder, but a plain bitwise and, where the expected output is 0, 0, 0, 1) there is always exactly one matching gate, which can be swapped with the failing output automatically. For the real input however, there are 4 failing bits in total, and each of them have 2, 3 or 4 other gates matching the pattern. These could be brute-forced, but I looked at the input text and drew the adders at the failing bit on paper, and figured out the two outputs to swap by looking at them.. After re-doing this because of 2 mistakes I got it. ;)
Your explanations are what helped me, a first timer, not only complete the problems but also understand the logic behind them. Never stop making vids and thank you for your service.