idk how to do multi line spoilers lol
letters = ['','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
total_score = 0
team = []
for line in open("input.txt"):
team.append(line.strip())
for i in range(2, len(team), 3):
for letter in team[i]:
if letter in team[i-2] and letter in team[i-1]:
total_score += letters.index(letter)
break
print(total_score)
some real caveman shit but it works
Jump in the discussion.
No email address required.
c++ Part one
Part two
Maybe i should just have just taken the o(n^2) pill and do it with 'in'.
Jump in the discussion.
No email address required.
Dont initialize your integers like that, it makes you look like a total fu cking tool. Also, use size_t and ++i in your for loop.
Jump in the discussion.
No email address required.
you're the reason c++ has namespaces
Jump in the discussion.
No email address required.
Dude, C++ is on a 3-year cycle, C++17, C++20, C++23. SMH my head plebs pretending to know shit.
Primitive initialization has different behaviors than classes, so there's no reason you need to treat them the same way, even stylistically.
Also, the bigger issue is that awful noob-like for loop that borders on being wrong, not just stylistic differences.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
congrats on using a sane language that dosent store everything in unicode by default![:marseycry: :marseycry:](/e/marseycry.webp)
Jump in the discussion.
No email address required.
More options
Context
Amazing parsing of code
Jump in the discussion.
No email address required.
More options
Context
you're fricking bananas if you think I'm reading all that, take my downmarsey and shut up idiot
Jump in the discussion.
No email address required.
More options
Context
More options
Context