r/excel • u/Downtown-Economics26 647 • Dec 03 '25
Discussion Advent of Code 2025 Day 3
It's back. Only 12 days of puzzles this year.
Today's puzzle "Lobby" link below.
https://adventofcode.com/2025/day/3
Three requests on posting answers:
Please try blacking out / marking as spoiler with at least your formula solutions so people don't get hints at how to solve the problems unless they want to see them.
The creator of Advent of Code requests you DO NOT share your puzzle input publicly to prevent others from cloning the site where a lot of work goes into producing these challenges.
There is no requirement on how you figure out your solution (many will be trying to do it in one formula, possibly including me) besides please do not share any ChatGPT/AI generated answers as this is a challenge for humans.
3
u/Anonymous1378 1542 Dec 03 '25 edited Dec 04 '25
Part 1
=LET(data,K31:K230,
split,LAMBDA(w,x,--MID(x,SEQUENCE(,MAX(LEN(x))+w),1)),
first,BYROW(split(-1,data),MAX),
second,BYROW(IFERROR(split(0,MAP(data,first,LAMBDA(y,z,TEXTAFTER(y,z)))),0),MAX),
SUM(--(first&second)))
Part 2
=LET(data,K31:K230,
split,LAMBDA(w,x,--MID(LEFT(x,LEN(x)+w),SEQUENCE(,MAX(LEN(x))),1)),
first,BYROW(IFERROR(--split(-11,data),0),MAX),
loop,LAMBDA(s,t,u,v,LET(p,MAP(u,v,LAMBDA(q,r,TEXTAFTER(q,RIGHT(r)))),IF(t=1,v,s(s,t+1,p,v&BYROW(IFERROR(--split(t,p),0),MAX))))),
SUM(--loop(loop,-10,data,first)))
Slight refinement to Part 2:
=LET(data,K31:K230,
split,LAMBDA(w,x,--MID(LEFT(x,LEN(x)-w+1),SEQUENCE(,MAX(LEN(x))),1)),
loop,LAMBDA(s,t,u,v,LET(p,MAP(u,v,LAMBDA(q,r,TEXTAFTER(q,IFERROR(RIGHT(r),"")))),IF(t=0,v,s(s,t-1,p,v&BYROW(IFERROR(--split(t,p),0),MAX))))),
SUM(--loop(loop,12,data,IF(ROW(data),""))))
2
u/Way2trivial 475 Dec 03 '25 edited Dec 03 '25
any answer works right? so long as you get it? even with 11 helper columns?
my b3 =VALUE(MAX(VALUE(UNIQUE(MID(A3,SEQUENCE(,LEN(A3)-(B$2)),1),TRUE))))
my c3 =TEXTAFTER(A3,B3)
b2 started at 11 down to x2 which had zero
then copied it over 11 times...
1
u/Downtown-Economics26 647 Dec 03 '25
Was able to do part 1 with a drag-down formula, will have to revisit Part 2 later to see if I can figure out a non-ridiculous formula solution, the part 2 solution looks relatively trivial to do in VBA.
Then take sum of the column.
3
u/PaulieThePolarBear 1927 Dec 03 '25
Part 1
=SUM(MAP(A1:A200,LAMBDA(m,LET(a, SEQUENCE(LEN(m)),b, --MID(m, a, 1),c, MAX(DROP(b,-1)),d, XMATCH(c, b),e, MAX(FILTER(b, a>d)),f, c*10+e,f))))Part 2 to follow later in my day
2
u/SheepiCagio 1 Dec 03 '25
I found today rather simple compared to the first two days. This provides the answers for part 1 and 2 simultaneously.
=MAP({2,12};LAMBDA(y;
SUM(BYROW(TEXTSPLIT(B1;;CHAR(10));LAMBDA(x;LET(
nrs;--MID(x;SEQUENCE(100);1);
--CONCAT(ROUNDDOWN(SCAN(0;SEQUENCE(y;;y;-1);LAMBDA(a;v;LET(
s;(a-ROUNDDOWN(a;0))*100;
rng;INDEX(nrs;SEQUENCE(101-s-v;;s+1));
loc;XMATCH(MAX(rng);rng)+s;
MAX(rng)+MIN(0.999;loc/100))));0))))))))
2
u/Murky-Pin-8541 Dec 03 '25
wild how fast these puzzles come and go, makes you appreciate the challenge more
2
u/RackofLambda 12 Dec 03 '25
=SUM(MAP(A:.A,LAMBDA(x,MAXJOLT(--MID(x,SEQUENCE(LEN(x)),1),12))))Where:
MAXJOLT = LAMBDA(vec,num,[rws],[acc],LET(rem,num-LEN(acc),IF(rem=1,VALUE(acc&MAX(vec)),LET(val,MAX(DROP(vec,rws)),pos,XMATCH(val,vec),IF(ROWS(vec)-pos+1<rem,MAXJOLT(vec,num,rws-1,acc),MAXJOLT(DROP(vec,pos),num,,acc&val))))))Works for Part 1 and 2 (set the
numvariable accordingly).2
u/finickyone 1770 Dec 06 '25
Bit bashy
>! =LET(v,A3,l,LEN(v),s,SEQUENCE(\l2)-1,i,INT(s/l)+1,m,MOD(s,l)+1,MAX(TOCOL(IF(m>i,MID(v,i,1)&MID(v,m,1),1/0),2)+0))
!<
1
u/Decronym Dec 03 '25 edited Dec 06 '25
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.
31 acronyms in this thread; the most compressed thread commented on today has 38 acronyms.
[Thread #46457 for this sub, first seen 3rd Dec 2025, 12:27] [FAQ] [Full list] ^[Contact] [Source code]