Update things
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user