Discover and read the best of Twitter Threads about #AdventOfCode2020

Most recents (2)

For this year's #AdventOfCode, my goal is to get each day's solution in the most readable format that will fit in a tweet. Striving for a compromise between conciseness and (subjective) elegance… 🧵
#AdventOfCode Day 1 (in Python 🐍):
# (relies on a few input assumptions)

data = [int(i) for i in open('01')]

print("Part 1:",
next(x*y for x in data for y in data if x+y == 2020))

print("Part 2:",
next(x*y*z for x in data for y in data for z in data if x+y+z == 2020))
#AdventOfCode Day 2 in 🐍

import re
L = [re.split('[: \-]', l) for l in open('02')]
L = [(int(p1), int(p2), [c == ch for c in pwd])
   for p1, p2, ch, _, pwd in L]

print("Part 1:",
sum(n1<= sum(m)<= n2 for n1, n2, m in L),
"Part 2:",
sum(m[p1-1]^m[p2-1] for p1, p2, m in L))
Read 48 tweets
[DAY2/24]
#ChristmasIsComing

Another topic, another discovery!

Let's play with #programming in a challenging way and with no pressure! Discover the #AdventOfCode initiative!

adventofcode.com

#adventofcode2020
"After saving Christmas five years in a row, you've decided to take a vacation at a nice resort on a tropical island. Surely, Christmas will go on without you."
"The tropical island has its own currency and is entirely cash-only. The gold coins used there have a little picture of a starfish; the locals just call them stars."
Read 5 tweets

Related hashtags

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!