mirror of
https://github.com/RGBCube/AdventOfCode
synced 2025-07-26 19:47:46 +00:00
Add python part 1
This commit is contained in:
parent
adb0b9bd29
commit
903560cc9c
3 changed files with 3 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -9,3 +9,4 @@
|
||||||
!*.md
|
!*.md
|
||||||
!*.nix
|
!*.nix
|
||||||
!*.nu
|
!*.nu
|
||||||
|
!*.py
|
||||||
|
|
1
2023/1-1.py
Normal file
1
2023/1-1.py
Normal file
|
@ -0,0 +1 @@
|
||||||
|
print(sum(int(__import__("functools").reduce(lambda x,y: x+y,(lambda a:[a[0],a[-1]])(list(filter(lambda c:c.isdigit(),l)))))for l in __import__("pathlib").Path("1-1.in").read_text().splitlines()))
|
2
run.nu
2
run.nu
|
@ -10,7 +10,7 @@ def main [
|
||||||
}
|
}
|
||||||
"py" => {
|
"py" => {
|
||||||
cd ($year_day_part_ext | path dirname)
|
cd ($year_day_part_ext | path dirname)
|
||||||
python $year_day_part_ext
|
python ($year_day_part_ext | path basename)
|
||||||
cd -
|
cd -
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue