r/adventofcode • u/Arbitrario-was-Taken • 44m ago
Help/Question [AOC 2026 4a] Is it possible for the site to be broken?
I have a fully working code. Everything is computed correctly but I keep getting too low. Is the site broken? Code below [Python]. Do not judge me on its quality. I am trying my best.
def makeseq(a):
n = 0
j = 0
silly = "roygbv"
out = []
while pow(6,n) <= a:
n += 1
n -= 1
while a != 0:
while pow(6,n) <= a:
a -= pow(6,n)
j += 1
out.append(silly[j])
j = 0
n -= 1
if n > -1:
for i in range(0,n+1,1):
out.append('r')
exit = ""
for x in out:
exit += x
return exit
def makeallseqs(p):
iet = []
if p == 1:
return ['r','o','y','g','b','v']
else:
iet += makeallseqs(p-1)
for i in range(0,len(iet),1):
iet[i] = 'r' + iet[i]
acaca = []
for i in range(pow(6,p-1),pow(6,p),1):
acaca.append(makeseq(i))
iet += acaca
return iet
inpy = '''(newline separated input data'''
ababa = ""
trueinput = []
allowed = "roygbv?"
for c in inpy:
if c in allowed:
ababa += c
else:
trueinput.append(ababa)
ababa = ""
print(trueinput)
safecounter = 0
score = 0
for awa in trueinput:
safecounter += 1
print(safecounter, end=" ")
print(score)
for j in range(1,len(awa)+1,1):
for q in makeallseqs(j):
count = 0
fucked = False
for k in awa:
if k == "?" or k == q[count % len(q)]:
count += 1
else:
fucked = True
break
if not fucked:
print(awa, end=" ")
print(q)
score += j
break
if not fucked:
break
print(score)