From 6b733982f9f240c1c97f1fa705bfbe4cd93c640e Mon Sep 17 00:00:00 2001 From: mhsn Date: Fri, 12 Sep 2025 20:20:58 +0100 Subject: simplify python file structure --- 2024/07/python/main.py | 35 ----------------------------------- 2024/07/python/pyproject.toml | 6 ------ 2 files changed, 41 deletions(-) delete mode 100644 2024/07/python/main.py delete mode 100644 2024/07/python/pyproject.toml (limited to '2024/07/python') diff --git a/2024/07/python/main.py b/2024/07/python/main.py deleted file mode 100644 index 0e72772..0000000 --- a/2024/07/python/main.py +++ /dev/null @@ -1,35 +0,0 @@ -from fileinput import input - -lines = [line.strip() for line in input()] - - -def solve(w, acc, rest, gold=False): - if not rest: - return w == acc - if w < acc: - return False - head, *rest = rest - return ( - solve(w, acc + head, rest, gold) - or solve(w, acc * head, rest, gold) - or (gold and solve(w, int(str(acc) + str(head)), rest, gold)) - ) - - -silver = 0 -gold = 0 - -for line in lines: - want, nums = line.split(":") - want = int(want) - nums = [int(n) for n in nums.split()] - head, *rest = nums - - if solve(want, head, rest): - silver += want - if solve(want, head, rest, True): - gold += want - - -print("silver:", silver) -print("gold:", gold) diff --git a/2024/07/python/pyproject.toml b/2024/07/python/pyproject.toml deleted file mode 100644 index bbd42d3..0000000 --- a/2024/07/python/pyproject.toml +++ /dev/null @@ -1,6 +0,0 @@ -[project] -name = "aoc-2024-07" -version = "0.1.0" -description = "advent of code 2024-07" -requires-python = ">=3.13" -dependencies = [] -- cgit v1.2.3