mirror of
https://github.com/Smaug123/advent-of-code-2021
synced 2025-10-12 07:18:39 +00:00
Day 1 in Mathematica
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
|||||||
**/target
|
**/target
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
*.nb
|
||||||
|
5
day_1/day_1.m
Normal file
5
day_1/day_1.m
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
ints = ReadList[StringJoin[NotebookDirectory[], "/input.txt"], "Number"];
|
||||||
|
|
||||||
|
part1 = Tr@Clip[Differences@#, {0, 1}] &;
|
||||||
|
|
||||||
|
part2 = Tr@Boole[Less @@@ Partition[#, 4, 1][[All, {1, 4}]]] &;
|
Reference in New Issue
Block a user