mirror of
https://github.com/Smaug123/advent-of-code-2021
synced 2025-10-12 15:28:42 +00:00
6 lines
182 B
Mathematica
6 lines
182 B
Mathematica
ints = ReadList[StringJoin[NotebookDirectory[], "/input.txt"], "Number"];
|
|
|
|
part1 = Tr@Clip[Differences@#, {0, 1}] &;
|
|
|
|
part2 = Tr@Boole[Less @@@ Partition[#, 4, 1][[All, {1, 4}]]] &;
|