Skip to content

Commit

Permalink
Cleaned up a bit more kotlin/day10.kts
Browse files Browse the repository at this point in the history
  • Loading branch information
romain-gaillard committed Dec 10, 2021
1 parent 76402b7 commit aaf1cb0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions kotlin/day10.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import java.util.ArrayDeque
val fileName = if (args.size > 0) args[0] else "day10.txt"
val lines = File(fileName).readLines()

var scorePartOneMap = mutableMapOf<Char, Int>(')' to 3, ']' to 57, '}' to 1197, '>' to 25137)
var scorePartTwoMap = mutableMapOf<Char, Int>('(' to 1, '[' to 2, '{' to 3, '<' to 4)
var closingChars = mutableMapOf<Char, Char>(')' to '(', ']' to '[', '}' to '{', '>' to '<')
var scorePartOneMap = mapOf<Char, Int>(')' to 3, ']' to 57, '}' to 1197, '>' to 25137)
var scorePartTwoMap = mapOf<Char, Int>('(' to 1, '[' to 2, '{' to 3, '<' to 4)
var closingChars = mapOf<Char, Char>(')' to '(', ']' to '[', '}' to '{', '>' to '<')

var scorePartOne = 0
var scoresPartTwo = mutableListOf<Long>()
val scoresPartTwo = mutableListOf<Long>()

linesLoop@ for (line in lines) {
var stack = ArrayDeque<Char>()
val stack = ArrayDeque<Char>()
var currentScorePartTwo = 0L

for (c in line) {
Expand Down

0 comments on commit aaf1cb0

Please sign in to comment.