Skip to content

Commit 5abe4b3

Browse files
committed
🎨 pls ruff
1 parent 5755de3 commit 5abe4b3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

aoc_25/solutions/day03.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
"987654321111111",
1515
"811111111111119",
1616
"234234234234278",
17-
"818181911112111"
17+
"818181911112111",
1818
]
19-
INPUT_DATA: list[str] = input_for_day(3, 2025, ff='list')
19+
INPUT_DATA: list[str] = input_for_day(3, 2025, ff="list")
2020

2121
# Hmm, actually I think I want a list of lists... who doesn't?
2222
DATA: ListsOfBatteryLists = [list(map(int, list(x))) for x in INPUT_DATA]
@@ -39,9 +39,9 @@ def part1(data: ListsOfBatteryLists) -> int:
3939
current_highest: int = 0
4040

4141
# Gotta sliiiide through that list like you're sliding into some DMs ;)
42-
for i in range(len(x)-1):
42+
for i in range(len(x) - 1):
4343
first_battery: int = x[i]
44-
the_rest: list[int] = x[i+1:] # the rest of battery gang, yadayada
44+
the_rest: list[int] = x[i + 1 :] # the rest of battery gang, yadayada
4545

4646
biggest_of_the_rest: int = max(the_rest) # Bigger IS better.
4747

@@ -83,15 +83,15 @@ def part2(data: ListsOfBatteryLists) -> int:
8383

8484
# peep the catchy as heck, short,
8585
# descriptive, easy to remember variable names ...
86-
highest_num_first_block: int = max(x[start_idx:first_block_len+1])
86+
highest_num_first_block: int = max(x[start_idx : first_block_len + 1])
8787
biggest_batteries.append(highest_num_first_block)
8888
highest_num_idx: int = x.index(
89-
highest_num_first_block, start_idx, first_block_len+1
89+
highest_num_first_block, start_idx, first_block_len + 1
9090
)
91-
start_idx = highest_num_idx+1
91+
start_idx = highest_num_idx + 1
9292
batteries_needed -= 1 # YEET 🔋
9393

94-
highest: str = ''.join(list(map(str, biggest_batteries)))
94+
highest: str = "".join(list(map(str, biggest_batteries)))
9595
# bigger, better, stronger.
9696
total_p2_joltage += int(highest)
9797
return total_p2_joltage

0 commit comments

Comments
 (0)