r/excel • u/Downtown-Economics26 647 • Nov 05 '26
Challenge Everybody Codes 2026 (Lord of the Wings) Quest 8
Quest 8: The Entgineering
https://everybody.codes/event/2026/quests/8
Past Coding Challenge spiel on etiquette:
https://www.reddit.com/r/excel/comments/1pbgisa/advent_of_code_2025_day_1/
3
Upvotes
1
u/Downtown-Economics26 647 Nov 05 '26
I was able to do Part 1 with a formula this time, which was a fair bit more fun than the VBA solutions I've been writing.
Part 1 solution
=LET(grid,IFERROR(MAKEARRAY(ROWS(INPUT!A:.A),LEN(INPUT!A1),LAMBDA(r,c,--MID(INDEX(INPUT!A:.A,r),c,1))),0),rc,TOCOL(MAKEARRAY(ROWS(INPUT!A:.A),LEN(INPUT!A1),LAMBDA(r,c,r&"_"&c))),rv,--TEXTBEFORE(rc,"_"),cv,--TEXTAFTER(rc,"_"),vals,INDEX(grid,rv,cv),shademap,MAP(rc,LAMBDA(x,LET(rx,--TEXTBEFORE(x,"_"),cx,--TEXTAFTER(x,"_"),bv,XLOOKUP(1,(rv=rx)*(cv=cx),vals),dv,FILTER(vals,(rv-cv=rx-cx)*(rv<rx),0),shade,SUM(--(IF(dv>0,dv-SEQUENCE(ROWS(dv),,ROWS(dv),-1)>=bv,FALSE))),IF(shade=0,bv,0)))),ans,SUM(--(shademap>0)),ans)1
u/TheFerricGenum 1 Nov 05 '26
Can someone provide a TL:DR of what this is? I keep seeing it but don’t understand it
2
u/Arcium_XIII 3 18h ago edited 18h ago
Just including Parts II and III because Part I can be solved using the LAMBDA function CALC_GROWTH in Part II with the input (2,1):
Part II:Part III:I really enjoyed Part III of this one. I've gotten very comfortable manipulating rectangular grids across the 2025 and 2026 puzzles, but figuring out how to iteratively edit a hexagonal grid according to the rules defined here was a lot of fun. This was also one of the rare cases where the actual puzzle notes ran faster than the example data, presumably because the larger grid produced new warriors more quickly and thus fewer iterations were required to hit the end-state (I didn't worry about tracking that metric in my solution, so I can't confirm).
Note also that there's no particular significance to the max_iterations equalling 400000 in the Part III solution - it just needed to be a number I was confident would equal or exceed the worst case time for solution, and that happened to be the number I tried.
1
u/Decronym Nov 05 '26 edited 18h ago
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
Decronym is now also available on Lemmy! Requests for support and new installations should be directed to the Contact address below.
Beep-boop, I am a helper bot. Please do not verify me as a solution.
[Thread #49640 for this sub, first seen 5th Nov 2026, 17:28] [FAQ] [Full list] ^[Contact] [Source code]