From 10caeb18b9c224c8b42ca724e956dba35807ec2c Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Thu, 4 Dec 2025 10:38:46 +0100 Subject: Small cleanup --- 2025/04/b.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to '2025/04/b.py') diff --git a/2025/04/b.py b/2025/04/b.py index 93b1fff..583c076 100644 --- a/2025/04/b.py +++ b/2025/04/b.py @@ -7,13 +7,14 @@ def neigh(a, i, j): a[i+1][j-1], a[i+1][j], a[i+1][j+1], ].count('@') -s = 0 with fileinput.input() as lines: - a = [['.'] * 200] - for line in lines: - a.append(['.'] + list(line.replace('\n', '.'))) - a.append(['.'] * 200) + a = [ + ['.'] * 200, + *[['.'] + list(line.replace('\n', '.')) for line in lines], + ['.'] * 200, + ] +s = 0 rem = True while rem: rem = False -- cgit v1.3