My Advent of Code solutions in Python. kevinyap.ca/2019/12/going-fast-in-advent-of-code/
advent-of-code python
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 24 lines 1.2 kB view raw
1import os, sys, re, math, copy, fileinput 2from string import ascii_uppercase, ascii_lowercase 3from collections import Counter, defaultdict, deque, namedtuple 4from itertools import count, product, permutations, combinations, combinations_with_replacement 5 6import advent 7from utils import parse_line, parse_nums, mul, all_unique, factors, memoize, primes, resolve_mapping 8from utils import chunks, parts, gcd, lcm, print_grid, min_max_xy 9from utils import new_table, transposed, rotated, firsts, lasts 10from utils import md5, sha256, VOWELS, CONSONANTS 11from utils import Point, DIRS, DIRS_4, DIRS_8, N, NE, E, SE, S, SW, W, NW 12# Itertools Functions: 13# product('ABCD', repeat=2) AA AB AC AD BA BB BC BD CA CB CC CD DA DB DC DD 14# permutations('ABCD', 2) AB AC AD BA BC BD CA CB CD DA DB DC 15# combinations_with_replacement('ABCD', 2) AA AB AC AD BB BC BD CC CD DD 16# combinations('ABCD', 2) AB AC AD BC BD CD 17 18# day .lines .nlines(negs=True) .pars .npars(negs=True) .board .pboard .tboard 19 20tot = 0 21res = [] 22 23day = advent.Day(year=2022, day=0) 24