def main(day): data = aocinput(day) instructions = [[part1, int(part2)] for line in data for part1, part2 in [line.strip().split(' ')]] result, _ = oneVisit(instructions) result2 = findBrokenInstruction(instructions) print(result, result2)
def main(day): data = aocinput(day) # setup add_reactions(data) find_depths() result = fuel_ammount(data) print(result)
def main(day): data = aocinput(day) data = [int(value) for value in data[0].split(',')] comp = IntcompExtract(data.copy()) comp.set_intcode(1, 12) comp.set_intcode(2, 2) comp.run() result = comp.get_intcode(0) noun_verb = find_noun_verb(data.copy()) print(result, noun_verb)
def main(day): data = aocinput(day) data = [int(value) for value in data[0].split(',')] test = TEST(data.copy(), 1) test.run() print(test.log[-1]) # part 2 test = TEST(data.copy(), 5) test.run() print(test.log[-1])
def main(day): data = aocinput(day) result = occupiedSeats(data) result2 = occupied2(data) print(result, result2)
def main(day): data = aocinput(day) data = sorted([int(item) for item in data]) result = findSum(data, 2020), findTripleSum(data, 2020) print(result)
def main(day): data = aocinput(day) data = [int(part) for part in data[0].strip().split(',')] result = find_oxygen(data) print(result)
def main(day): data = [line.strip() for line in aocinput(day)] print(checksum(data)) print(commonLetters(data))
def main(day): data = aocinput(day) result = memorySum(data) result2 = memorySum2(data) print(result, result2)
def main(day): data = aocinput(day) result = decode_image(data[0]) print(result[0]) print(result[1])
def main(day): data = aocinput(day) result = matchRules(data) print(result)
def main(day): data = list(map(int, aocinput(day)[0].split())) print(sumMetadata(data)) print(sumMetaData2(data))
def main(day): data = aocinput(day) result = activeCubes(data) result2 = activeCubes(data, 4) print(result, result2)
def main(day): data = aocinput(day) result = containsBag(data) print(result)
def main(day): data = aocinput(day) result = findCorners(data) print(result)
def main(day): data = aocinput(day) result = validPasswords(data) print(result)
def main(day: int): data = aocinput(day) print(sum_fuel(data))
def main(day): data = aocinput(day) result = find_orbits(data) print(result)
def main(day): data = aocinput(day) result = earliestBus(data) result2 = offsetDeparting(data) print(result, result2)
def main(day): data = aocinput(day) print(largestAreas(data))
def main(day): data = aocinput(day) print(displayMessage(data))
def main(day): data = aocinput(day) print(recipe(data[0]))
def main(day): data = [line.strip() for line in aocinput(day)] data1 = data[:3124] data2 = data[3126:] print(multibehave(data1)) print(testprogram(data1, data2))
def main(day): data = aocinput(day) result = maximize_thrusters([int(i) for i in data[0].split(',')]) print(result)
def main(day): data = aocinput(day) result = closest_intersection(data) print(result)
def main(day): data = aocinput(day) result = best_location(data) print(result)
def main(day): data = aocinput(day) data = [[char == '#' for char in line.strip()] for line in data] result1 = treeEncounters(data) result2 = minimizeEncounters(data) print(result1, result2)
def main(day): data = aocinput(day) result = evalHomeWork(data, samePrecidence) result2 = evalHomeWork(data, plusPrecidence) print(result, result2)
def main(day): data = aocinput(day) print(mostSleep(data))
def main(day): data = aocinput(day) instructions = [(line[0], int(line[1:])) for line in data] result = getDistance(instructions) result2 = waypointMovement(instructions) print(result, result2)