From 0eda433d6adfa236da52f956faa1b634d044c1c9 Mon Sep 17 00:00:00 2001 From: Allianzcortex Date: Mon, 8 Dec 2025 10:49:07 -0500 Subject: [PATCH] add day7 solution --- advent_of_code/2025(python)/day7.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 advent_of_code/2025(python)/day7.py diff --git a/advent_of_code/2025(python)/day7.py b/advent_of_code/2025(python)/day7.py new file mode 100644 index 0000000..f1c8161 --- /dev/null +++ b/advent_of_code/2025(python)/day7.py @@ -0,0 +1,21 @@ + +def solve_day7_part1(input_): + input_ = [list(line) for line in input_] + split_cnt = 0 + for i, line in enumerate(input_): + if i == 0: + line[line.index('S')] = '|' + continue + + for j, ch in enumerate(line): + if input_[i-1][j] == '|': + if ch == '^': + split_cnt += 1 + if j > 0: + line[j-1] = '|' + if j < len(line)-1: + line[j+1] = '|' + else: + line[j] = '|' + + return split_cnt