From d38649aa2e9e79f8c5bbabef3e39de38342702e1 Mon Sep 17 00:00:00 2001 From: tchojnacki Date: Sat, 4 Dec 2021 13:24:49 +0100 Subject: Complete day 4 --- src/Utils.kt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Utils.kt') diff --git a/src/Utils.kt b/src/Utils.kt index 27b88b5..6268ba6 100644 --- a/src/Utils.kt +++ b/src/Utils.kt @@ -9,6 +9,13 @@ import java.security.MessageDigest */ fun readInputAsLines(name: String): List = File("src", "$name.txt").readLines() +/** + * Returns a string of contents of the given input txt file. + * @param name name of the file + * @return contents of file as string + */ +fun readInputAsString(name: String): String = File("src", "$name.txt").readText() + /** * Read lines from the given input txt file and convert them to decimal numbers. * @param name name of the file -- cgit v1.2.3