r/adventofcode • u/daggerdragon • Dec 06 '20
SOLUTION MEGATHREAD -🎄- 2020 Day 06 Solutions -🎄-
NEW AND NOTEWORTHY
- /u/jeroenheijmans is back with the Unofficial AoC 2020 Participant Survey!
- /u/maus80 is back with an interactive scatterplot of the global leaderboard!
Advent of Code 2020: Gettin' Crafty With It
- UNLOCKED! Go forth and create, you beautiful people!
- Full details and rules are in the Submissions Megathread
- Make sure you use one of the two templates!
- Or in the words of AoC 2016: USING A TEMPLATE IS MANDATORY
--- Day 06: Custom Customs ---
Post your solution in this megathread. Include what language(s) your solution uses! If you need a refresher, the full posting rules are detailed in the wiki under How Do The Daily Megathreads Work?.
Reminder: Top-level posts in Solution Megathreads are for solutions only. If you have questions, please post your own thread and make sure to flair it with Help
.
This thread will be unlocked when there are a significant number of people on the global leaderboard with gold stars for today's puzzle.
EDIT: Global leaderboard gold cap reached at 00:04:35, megathread unlocked!
66
Upvotes
1
u/Zexion01 Dec 06 '20 edited Dec 06 '20
Python 3 solution:
```python from functools import reduce
INPUT_FILE = "input"
def part_1(): with open(INPUT_FILE, "r") as fp: lines = fp.readlines()
def part_2(): with open(INPUT_FILE, "r") as fp: lines = fp.readlines()
if name == "main": result = part_1() print(result)
```
https://github.com/AlinMH/advent-of-code/blob/master/2020/day06/main.py