Skip to content

Commit 076dc19

Browse files
committed
2024 solutions: Fix whitespace
1 parent 512db15 commit 076dc19

File tree

6 files changed

+16
-9
lines changed

6 files changed

+16
-9
lines changed

2024/solutions/day02.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import sys
44

5+
56
def safe(ints, allow_removal=False):
67
for i in range(len(ints) - 1):
78
if not 1 <= ints[i + 1] - ints[i] <= 3:

2024/solutions/day04.py

+3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

33
import sys
44

5+
56
def grid_char(r, c):
67
global GRID, WIDTH, HEIGHT
78

89
if 0 <= r < HEIGHT and 0 <= c < WIDTH:
910
return GRID[r][c]
1011
return ''
1112

13+
1214
def count_xmas(r, c):
1315
global GRID
1416

@@ -31,6 +33,7 @@ def count_xmas(r, c):
3133

3234
return count
3335

36+
3437
def check_xmas(r, c):
3538
global GRID
3639

2024/solutions/day08.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66

77

88
def antinodes(r1, c1, r2, c2):
9-
global HEIGHT, WIDTH
9+
global HEIGHT, WIDTH
1010

11-
r = 2 * r2 - r1
12-
c = 2 * c2 - c1
13-
if 0 <= r < HEIGHT and 0 <= c < WIDTH:
14-
yield r, c
11+
r = 2 * r2 - r1
12+
c = 2 * c2 - c1
13+
if 0 <= r < HEIGHT and 0 <= c < WIDTH:
14+
yield r, c
1515

16-
r = 2 * r1 - r2
17-
c = 2 * c1 - c2
18-
if 0 <= r < HEIGHT and 0 <= c < WIDTH:
19-
yield r, c
16+
r = 2 * r1 - r2
17+
c = 2 * c1 - c2
18+
if 0 <= r < HEIGHT and 0 <= c < WIDTH:
19+
yield r, c
2020

2121

2222
def points_on_line(r1, c1, r2, c2):

2024/solutions/day11.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from functools import lru_cache
55
from math import log10
66

7+
78
@lru_cache(None)
89
def calc(n, blinks=25):
910
if blinks == 0:

2024/solutions/day13.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import sys
44
from re import findall
55

6+
67
def solve(ax, ay, bx, by, px, py):
78
# Solve the linear system of two equations (with a and b unknown):
89
# ax * a + bx * b = px

2024/solutions/day14.py

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from dataclasses import dataclass
77
from math import prod
88

9+
910
@dataclass
1011
class Robot:
1112
x: int

0 commit comments

Comments
 (0)