1
0
mirror of https://github.com/chylex/Advent-of-Code.git synced 2025-05-25 00:34:06 +02:00

Add 2021 - Day 1 - Part 1

This commit is contained in:
chylex 2021-12-01 06:38:07 +01:00
parent 840577f13b
commit 2f09ca9982
Signed by: chylex
GPG Key ID: 4DE42C8F19A80548
3 changed files with 2018 additions and 0 deletions
.idea/runConfigurations
2021/01

View File

@ -0,0 +1,11 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="2021 - Day 01" type="JetRunConfigurationType">
<option name="MAIN_CLASS_NAME" value="MainKt" />
<module name="Advent_of_Code.2021-01" />
<shortenClasspath name="NONE" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/2021/01" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>

2000
2021/01/input/1.txt Normal file

File diff suppressed because it is too large Load Diff

7
2021/01/main.kt Normal file
View File

@ -0,0 +1,7 @@
import java.io.File
fun main() {
val lines = File("input/1.txt").readLines().map(String::toInt)
val totalIncreases = lines.windowed(2).count { it[1] > it[0] }
println("Total Increases: $totalIncreases")
}