diff options
Diffstat (limited to 'src/Utils.kt')
-rw-r--r-- | src/Utils.kt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Utils.kt b/src/Utils.kt index 27b88b5..6268ba6 100644 --- a/src/Utils.kt +++ b/src/Utils.kt @@ -10,6 +10,13 @@ import java.security.MessageDigest fun readInputAsLines(name: String): List<String> = 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 * @return list of ints containing numbers from each of file's lines |