Created
December 1, 2021 13:49
-
-
Save FeepingCreature/3c86901efb7fef5a6ab6d49d9e798090 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module day1; | |
macro import neat.macros.listcomprehension; | |
import std.stdio; | |
import std.file; | |
import std.string; | |
void main() { | |
[depth.atoi for depth in "day1.txt".readText.split("\n")] | |
.([(depth, that[i + 1]) for i, depth in that[0 .. $ - 1]]) | |
.([count pair in that where pair[0] < pair[1]]) | |
.(print("$that increases.")); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
import itertools
print(sum([b > a for a, b in itertools.pairwise(map(int, open("input1").readlines()))]))