You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
########################## PART 2: ONE-LINE SOLUTION ##########################
66
+
print('Day 15 Part 2:',sum((b:=[[] for_inrange(256)]) and [((l:=''.join([cforcinsifc.isalpha()])) and (o:=''.join([cforcinsifnotc.isalnum()])) and (f:=''.join([cforcinsifc.isdigit()])) and (d:=(l,f)) and (a:=0) or1) andnot (a:=0) and [a:=(a+ord(c))*17%256forcinl] and ((b[a].append(d) iflnotin [x[0] forxinb[a]] else ((e:=[x[0] forxinb[a]].index(l)) or1) andb[a].pop(e) andb[a].insert(e,d)) ifo=='='elseb[a].pop([x[0] forxinb[a]].index(l)) iflin [x[0] forxinb[a]] else0) forsinq[15].split(',')] and [(i+1)*(j+1)*int(n[1]) fori,pinenumerate(b) forj,ninenumerate(p)]))
0 commit comments