Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions advent_of_code/2025(python)/day7.py
Original file line number Diff line number Diff line change
@@ -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
Loading