File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,14 @@ fun main() {
77 return input.size
88 }
99
10- // test if implementation meets criteria from the description, like:
10+ // Test if implementation meets criteria from the description, like:
11+ check(part1(listOf (" test_input" )) == 1 )
12+
13+ // Or read a large test input from the `src/Day01_test.txt` file:
1114 val testInput = readInput(" Day01_test" )
1215 check(part1(testInput) == 1 )
1316
17+ // Read the input from the `src/Day01.txt` file.
1418 val input = readInput(" Day01" )
1519 part1(input).println ()
1620 part2(input).println ()
Original file line number Diff line number Diff line change 11import java.math.BigInteger
22import java.security.MessageDigest
33import kotlin.io.path.Path
4- import kotlin.io.path.readLines
4+ import kotlin.io.path.readText
55
66/* *
77 * Reads lines from the given input txt file.
88 */
9- fun readInput (name : String ) = Path (" src/$name .txt" ).readLines ()
9+ fun readInput (name : String ) = Path (" src/$name .txt" ).readText().trim().lines ()
1010
1111/* *
1212 * Converts string to md5 hash.
You can’t perform that action at this time.
0 commit comments