Initial commit: AoC solutions 2023-2025
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
import re
|
||||
import time
|
||||
|
||||
def main():
|
||||
with open("/Users/samuelenocsson/dev/advent-of-code/5-input.txt", 'r') as file:
|
||||
row_cache = {}
|
||||
start_time = time.time()
|
||||
seed_string = file.readline()
|
||||
lines = file.readlines()
|
||||
maps =[]
|
||||
for idx, line in enumerate(lines):
|
||||
numbers = [int(digit) for digit in re.findall(r'\d+', line)]
|
||||
if len(numbers) > 0:
|
||||
maps.append(numbers)
|
||||
|
||||
seeds = [int(digit) for digit in re.findall(r'\d+', seed_string)]
|
||||
for seed in seeds:
|
||||
sources = []
|
||||
sources.append(seed)
|
||||
for m in maps:
|
||||
current = sources.pop()
|
||||
current_start = current[0]
|
||||
current_end = current[1]
|
||||
|
||||
|
||||
|
||||
location = -1
|
||||
next = 0
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user