1
0

Update things

This commit is contained in:
2021-12-01 19:32:38 +01:00
parent ccfcf5a259
commit 322f8eb45a
53 changed files with 156 additions and 239 deletions
+2 -3
View File
@@ -1,7 +1,6 @@
package be.vandewalleh.aoc.days
import be.vandewalleh.aoc.utils.input.Day
import be.vandewalleh.aoc.utils.input.Input
import be.vandewalleh.aoc.utils.input.Lines
import org.eclipse.collections.api.factory.Stacks
import org.eclipse.collections.api.multimap.list.ImmutableListMultimap
@@ -9,7 +8,7 @@ import org.eclipse.collections.api.stack.MutableStack
import org.eclipse.collections.impl.factory.Multimaps
@Day(7)
class Day07(@Lines val input: Input<List<String>>) {
class Day07(@Lines val input: List<String>) {
private data class Bag(val count: Int, val color: String)
@@ -21,7 +20,7 @@ class Day07(@Lines val input: Input<List<String>>) {
val colorRegex = "^(\\w+ \\w+)".toRegex()
val requirementRegex = "(\\d+) (\\w+ \\w+) bag".toRegex()
for (line in input.value) {
for (line in input) {
val outerColor = colorRegex.find(line)!!.groupValues[1]
for (match in requirementRegex.findAll(line)) {
val (_, count, color) = match.groupValues