Skip to content

Commit

Permalink
all days clean up, better complexity measure
Browse files Browse the repository at this point in the history
  • Loading branch information
vsedov committed Dec 5, 2024
1 parent ce988f7 commit a410aa9
Show file tree
Hide file tree
Showing 5 changed files with 345 additions and 109 deletions.
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ dependencies = [
"aocd>=0.1",
"icecream>=2.1.3",
"numba>=0.60.0",
"psutil>=6.1.0",
"memory-profiler>=0.61.0",
"line-profiler>=4.2.0",
"bigo>=0.2",
"big-o>=0.11.0",
"rich>=13.9.4",
]
requires-python = ">=3.12"
readme = "README.md"
Expand Down
4 changes: 1 addition & 3 deletions src/aoc/aoc2024/day_05.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ def find_valid_order(deps: npt.NDArray, numbers: npt.NDArray) -> npt.NDArray:
n = len(numbers)
result = np.empty(n, dtype=np.int64)
used = np.zeros(n, dtype=np.bool_)

num_deps = deps[numbers][:, numbers]

in_degree = num_deps.sum(axis=0)

for pos in range(n):
Expand Down Expand Up @@ -89,7 +87,7 @@ def main(txt: str) -> None:

if __name__ == "__main__":
aoc = Aoc(day=get_day(), years=YEAR)
aoc.run(main, submit=True, part="both", readme_update=True)
aoc.run(main, submit=False, part="both", readme_update=True, profile=True)

# @njit
# def check_order(deps: npt.NDArray, sequence: npt.NDArray) -> bool:
Expand Down
4 changes: 2 additions & 2 deletions src/aoc/aoc2024/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
| 01 | [Historian Hysteria](https://adventofcode.com/2024/day/1) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| 02 | [Red-Nosed Reports](https://adventofcode.com/2024/day/2) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| 03 | [Mull It Over](https://adventofcode.com/2024/day/3) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| 04 | [Ceres Search](https://adventofcode.com/2024/day/4) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| 05 | [Print Queue](https://adventofcode.com/2024/day/5) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| 04 | [Ceres Search](https://adventofcode.com/2024/day/4) | | | |
| 05 | [Print Queue](https://adventofcode.com/2024/day/5) | | | |
| 06 | [?](https://adventofcode.com/2024/day/6) | :x: | :x: | :x: |
| 07 | [?](https://adventofcode.com/2024/day/7) | :x: | :x: | :x: |
| 08 | [?](https://adventofcode.com/2024/day/8) | :x: | :x: | :x: |
Expand Down
Loading

0 comments on commit a410aa9

Please sign in to comment.