Skip to content

Commit

Permalink
AoC 2023 Day 6 Part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
pareronia committed Dec 6, 2023
1 parent d4cea80 commit 8a58fb0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- @BEGIN:ImplementationsTable:2023@ -->
| | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| ---| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| python3 | [βœ“](src/main/python/AoC2023_01.py) | [βœ“](src/main/python/AoC2023_02.py) | [βœ“](src/main/python/AoC2023_03.py) | [βœ“](src/main/python/AoC2023_04.py) | [βœ“](src/main/python/AoC2023_05.py) | | | | | | | | | | | | | | | | | | | | |
| python3 | [βœ“](src/main/python/AoC2023_01.py) | [βœ“](src/main/python/AoC2023_02.py) | [βœ“](src/main/python/AoC2023_03.py) | [βœ“](src/main/python/AoC2023_04.py) | [βœ“](src/main/python/AoC2023_05.py) | [βœ“](src/main/python/AoC2023_06.py) | | | | | | | | | | | | | | | | | | | |
| java | [βœ“](src/main/java/AoC2023_01.java) | [βœ“](src/main/java/AoC2023_02.java) | [βœ“](src/main/java/AoC2023_03.java) | [βœ“](src/main/java/AoC2023_04.java) | | | | | | | | | | | | | | | | | | | | | |
| bash | | | | | | | | | | | | | | | | | | | | | | | | | |
| c++ | | | | | | | | | | | | | | | | | | | | | | | | | |
Expand Down
12 changes: 10 additions & 2 deletions src/main/python/AoC2023_06.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,20 @@ def part_1(self, races: Input) -> Output1:
return ans

def part_2(self, races: Input) -> Output2:
return 0
time = int("".join(str(r[0]) for r in races))
distance = int("".join(str(r[1]) for r in races))
log((time, distance))
ans = 0
for t in range(time + 1):
d = (time - t) * t
if d > distance:
ans += 1
return ans

@aoc_samples(
(
("part_1", TEST, 288),
# ("part_2", TEST, "TODO"),
("part_2", TEST, 71503),
)
)
def samples(self) -> None:
Expand Down

0 comments on commit 8a58fb0

Please sign in to comment.