Browse Source

[2020-12-07] Add solutions for day07

master
Elis Hirwing 10 months ago
parent
commit
2e7c5439e7
Signed by: etu GPG Key ID: D57EFA625C9A925F
  1. 2
      Makefile
  2. 9
      day07/example.txt
  3. 594
      day07/input.txt
  4. 44
      day07/lib.go
  5. 50
      day07/parse.go
  6. 17
      day07/solve1.go
  7. 11
      day07/solve2.go
  8. 4
      main.go

2
Makefile

@ -21,6 +21,8 @@ day06:
go run main.go day06 input
day07:
go run main.go day07 input
day08:
day09:
day10:

9
day07/example.txt

@ -0,0 +1,9 @@
light red bags contain 1 bright white bag, 2 muted yellow bags.
dark orange bags contain 3 bright white bags, 4 muted yellow bags.
bright white bags contain 1 shiny gold bag.
muted yellow bags contain 2 shiny gold bags, 9 faded blue bags.
shiny gold bags contain 1 dark olive bag, 2 vibrant plum bags.
dark olive bags contain 3 faded blue bags, 4 dotted black bags.
vibrant plum bags contain 5 faded blue bags, 6 dotted black bags.
faded blue bags contain no other bags.
dotted black bags contain no other bags.

594
day07/input.txt

@ -0,0 +1,594 @@
vibrant purple bags contain 3 shiny lavender bags, 1 mirrored gray bag, 4 muted bronze bags.
posh crimson bags contain 4 drab plum bags, 5 dotted purple bags, 3 vibrant lavender bags, 2 striped plum bags.
pale cyan bags contain 5 drab violet bags, 2 dotted crimson bags.
dim lime bags contain 1 muted purple bag, 2 striped silver bags.
clear aqua bags contain 2 plaid green bags.
bright teal bags contain 4 shiny crimson bags, 3 faded red bags, 2 posh lavender bags.
clear white bags contain 1 pale olive bag, 2 vibrant plum bags, 4 clear cyan bags.
dull plum bags contain 1 bright yellow bag, 5 bright tomato bags.
dark crimson bags contain 3 dotted gray bags.
shiny green bags contain 4 pale violet bags, 3 muted teal bags.
clear salmon bags contain 1 light yellow bag.
dull salmon bags contain 1 dim lavender bag, 3 faded teal bags, 4 dotted beige bags, 1 faded red bag.
pale black bags contain 4 drab maroon bags, 4 dotted orange bags, 1 shiny black bag, 4 mirrored yellow bags.
vibrant olive bags contain 5 clear chartreuse bags, 4 clear blue bags, 4 mirrored orange bags, 1 posh tomato bag.
shiny blue bags contain 3 light green bags, 5 dark chartreuse bags.
dark teal bags contain 1 posh maroon bag.
vibrant brown bags contain no other bags.
striped crimson bags contain 2 shiny gold bags, 4 pale indigo bags, 4 light maroon bags.
bright fuchsia bags contain 1 posh purple bag, 4 clear gold bags, 5 dark teal bags, 2 plaid orange bags.
bright black bags contain 1 bright teal bag, 4 dull olive bags, 5 posh turquoise bags, 3 dotted teal bags.
striped beige bags contain 3 dark indigo bags, 1 drab aqua bag.
dim crimson bags contain 5 striped turquoise bags, 4 faded brown bags.
vibrant black bags contain 2 mirrored gray bags, 5 light maroon bags, 5 pale plum bags, 3 mirrored black bags.
muted chartreuse bags contain 4 dim indigo bags.
dotted bronze bags contain 3 clear aqua bags, 2 bright tan bags, 4 muted brown bags, 1 bright maroon bag.
posh cyan bags contain 1 vibrant black bag, 3 vibrant coral bags.
mirrored brown bags contain 5 pale gray bags, 4 dim beige bags.
vibrant indigo bags contain 5 mirrored maroon bags, 3 drab purple bags.
clear maroon bags contain 5 dotted teal bags, 4 wavy black bags.
faded silver bags contain 2 plaid red bags, 1 posh green bag, 3 vibrant magenta bags, 2 bright magenta bags.
light coral bags contain 5 dull turquoise bags.
wavy beige bags contain 2 shiny yellow bags, 1 shiny lavender bag, 3 plaid bronze bags.
faded fuchsia bags contain 5 light maroon bags, 2 mirrored cyan bags, 3 light aqua bags.
dark fuchsia bags contain 2 dotted blue bags, 5 muted olive bags, 5 posh coral bags, 4 clear salmon bags.
vibrant white bags contain 1 dim lavender bag.
bright plum bags contain 2 shiny tan bags.
wavy green bags contain 1 light beige bag, 5 mirrored blue bags, 1 pale turquoise bag.
posh magenta bags contain 4 dim violet bags, 3 clear aqua bags.
plaid coral bags contain 3 wavy salmon bags, 2 dark gold bags.
dull orange bags contain 1 dull green bag.
shiny aqua bags contain 1 plaid yellow bag, 3 shiny green bags, 5 vibrant bronze bags, 2 striped olive bags.
dotted teal bags contain 1 light gray bag, 1 dotted beige bag, 3 shiny gold bags, 3 faded tan bags.
dotted red bags contain 3 mirrored gray bags, 1 mirrored lime bag.
muted fuchsia bags contain 4 drab tan bags.
striped tomato bags contain 1 wavy silver bag, 3 bright blue bags, 5 drab silver bags, 5 dim orange bags.
vibrant coral bags contain 5 shiny plum bags, 5 pale aqua bags.
plaid gold bags contain 1 mirrored cyan bag, 2 dull lavender bags.
posh olive bags contain 1 shiny coral bag, 4 clear beige bags, 4 light bronze bags, 2 striped olive bags.
posh teal bags contain 1 drab yellow bag.
bright green bags contain 4 drab purple bags, 5 shiny yellow bags.
pale lavender bags contain 3 drab olive bags, 2 muted beige bags, 4 muted blue bags, 1 dim fuchsia bag.
faded green bags contain 1 dim turquoise bag, 5 drab cyan bags, 2 clear tomato bags, 2 light brown bags.
wavy blue bags contain 2 striped red bags, 5 dark gold bags, 5 clear white bags.
plaid olive bags contain 5 pale aqua bags.
muted purple bags contain 4 bright bronze bags.
vibrant turquoise bags contain 1 dark silver bag, 5 plaid teal bags, 5 posh turquoise bags.
striped chartreuse bags contain 5 muted bronze bags, 2 wavy salmon bags.
drab cyan bags contain 2 posh tomato bags, 1 wavy turquoise bag.
vibrant silver bags contain 3 light violet bags, 4 vibrant brown bags, 2 light beige bags, 5 dark indigo bags.
faded salmon bags contain 5 dim beige bags, 5 dotted beige bags.
light cyan bags contain 4 plaid beige bags, 5 vibrant black bags, 4 pale chartreuse bags, 4 plaid gray bags.
light aqua bags contain 5 faded red bags.
vibrant lavender bags contain 1 bright black bag, 5 plaid indigo bags.
drab salmon bags contain 1 dotted gray bag, 5 mirrored silver bags, 1 shiny bronze bag, 1 faded bronze bag.
striped coral bags contain 4 light silver bags.
vibrant gray bags contain 5 striped green bags, 2 light turquoise bags.
dark aqua bags contain 3 dark teal bags, 5 clear bronze bags, 5 dotted tan bags.
dark olive bags contain 5 light gold bags, 3 dark green bags.
clear lime bags contain 5 dull red bags, 3 mirrored salmon bags, 1 bright crimson bag, 4 vibrant black bags.
dull gold bags contain 1 dark violet bag, 1 dim chartreuse bag, 1 vibrant lavender bag, 2 clear red bags.
dim black bags contain 5 dull black bags, 3 faded silver bags, 5 pale red bags.
clear yellow bags contain 2 clear beige bags, 2 shiny fuchsia bags, 1 plaid coral bag.
mirrored gold bags contain 5 dotted plum bags.
dotted maroon bags contain 3 dotted purple bags.
dim bronze bags contain 2 wavy magenta bags, 2 drab red bags.
wavy white bags contain 3 dull lime bags, 4 drab tan bags.
vibrant aqua bags contain 1 drab tan bag, 3 light crimson bags.
mirrored cyan bags contain 2 dull olive bags.
faded crimson bags contain 3 bright fuchsia bags, 5 dotted chartreuse bags, 4 striped plum bags.
faded purple bags contain 5 faded lime bags, 3 drab lavender bags.
striped black bags contain 1 vibrant tan bag, 1 drab maroon bag.
striped magenta bags contain 2 drab lavender bags, 2 shiny bronze bags, 2 posh salmon bags.
shiny olive bags contain 1 posh violet bag, 4 dotted orange bags, 1 drab maroon bag, 5 drab lavender bags.
dull tan bags contain 1 wavy violet bag, 2 plaid plum bags, 4 bright lavender bags.
pale indigo bags contain 1 striped chartreuse bag, 4 bright magenta bags, 5 wavy salmon bags.
dotted magenta bags contain 4 posh red bags, 2 light lime bags, 2 dull fuchsia bags.
vibrant blue bags contain 2 drab brown bags, 3 muted orange bags.
clear turquoise bags contain 2 muted crimson bags, 2 drab bronze bags, 4 drab white bags, 1 clear white bag.
drab bronze bags contain 1 faded olive bag, 4 dim indigo bags, 3 pale black bags.
shiny white bags contain 5 pale plum bags, 1 mirrored aqua bag.
striped teal bags contain 1 dull lime bag.
light lavender bags contain 2 mirrored brown bags, 3 bright orange bags.
light magenta bags contain 3 striped silver bags, 1 drab yellow bag, 4 bright orange bags, 5 dotted lavender bags.
mirrored salmon bags contain 2 bright magenta bags, 3 drab aqua bags, 3 shiny gold bags.
muted lavender bags contain 5 wavy chartreuse bags, 1 dark coral bag, 2 plaid gray bags.
muted yellow bags contain 1 dim lavender bag, 5 faded gold bags, 3 clear beige bags.
vibrant maroon bags contain 1 faded salmon bag, 2 vibrant tan bags, 1 posh fuchsia bag, 5 plaid gold bags.
bright lavender bags contain 2 pale gray bags.
plaid salmon bags contain 5 dull fuchsia bags, 4 faded gold bags, 2 dark teal bags, 1 bright teal bag.
dark turquoise bags contain 1 dull fuchsia bag, 3 dull tomato bags, 1 striped cyan bag.
dark indigo bags contain 1 dotted red bag.
light green bags contain 4 vibrant bronze bags, 1 wavy black bag, 1 dark black bag.
drab magenta bags contain 5 mirrored beige bags, 1 faded brown bag.
clear coral bags contain 5 posh green bags, 5 dull yellow bags, 2 dim salmon bags.
light red bags contain 1 light silver bag, 1 mirrored lime bag.
muted beige bags contain 2 drab yellow bags, 4 light maroon bags, 2 shiny yellow bags.
pale blue bags contain 5 mirrored crimson bags, 1 drab salmon bag, 2 posh lime bags.
drab crimson bags contain 2 light salmon bags, 5 pale gray bags, 2 wavy beige bags.
faded maroon bags contain 5 mirrored gold bags.
bright indigo bags contain 5 pale gray bags.
dull teal bags contain 3 faded silver bags, 1 vibrant lime bag, 1 mirrored crimson bag.
shiny salmon bags contain 3 bright magenta bags, 4 dotted blue bags, 1 dotted maroon bag, 3 bright beige bags.
mirrored beige bags contain 1 vibrant magenta bag, 5 light silver bags, 5 shiny lavender bags.
pale tan bags contain 4 striped magenta bags, 1 clear cyan bag, 1 clear beige bag, 1 mirrored purple bag.
drab tan bags contain 5 mirrored maroon bags.
dark yellow bags contain 2 dull olive bags, 4 dull teal bags, 4 light yellow bags, 1 faded fuchsia bag.
drab green bags contain 1 clear magenta bag.
pale turquoise bags contain 2 drab chartreuse bags.
plaid silver bags contain 3 dotted beige bags, 2 plaid orange bags.
vibrant red bags contain 5 muted magenta bags, 4 drab white bags, 1 drab aqua bag.
muted maroon bags contain 2 shiny coral bags.
mirrored purple bags contain 4 mirrored aqua bags.
muted white bags contain 2 plaid green bags, 2 posh green bags, 5 faded gray bags.
bright chartreuse bags contain 2 bright lavender bags, 1 muted tan bag.
vibrant orange bags contain 4 muted bronze bags, 5 vibrant magenta bags.
clear chartreuse bags contain 2 plaid red bags, 2 striped teal bags, 5 dotted fuchsia bags.
clear gray bags contain 1 dull beige bag, 3 light aqua bags.
striped indigo bags contain 2 faded chartreuse bags, 4 dull white bags, 5 mirrored maroon bags, 1 plaid coral bag.
posh green bags contain 1 bright tan bag.
dark salmon bags contain 5 wavy yellow bags.
muted tomato bags contain 3 muted beige bags, 2 faded gray bags, 2 clear gold bags.
posh silver bags contain 2 dotted beige bags, 2 pale fuchsia bags, 1 dark brown bag.
mirrored white bags contain 5 dim white bags, 3 light aqua bags, 2 faded gray bags, 3 shiny gold bags.
drab chartreuse bags contain 5 mirrored plum bags, 2 dim aqua bags, 1 vibrant brown bag, 5 vibrant orange bags.
light blue bags contain 3 dim chartreuse bags, 1 bright green bag, 3 clear chartreuse bags.
posh white bags contain 1 dull brown bag, 3 bright magenta bags.
dotted violet bags contain 3 plaid gray bags, 5 pale white bags, 5 wavy blue bags, 1 mirrored magenta bag.
drab plum bags contain 1 dull salmon bag, 2 muted magenta bags.
plaid violet bags contain 3 bright olive bags.
wavy crimson bags contain 2 bright purple bags, 3 shiny yellow bags, 3 posh bronze bags.
dull yellow bags contain 1 plaid red bag, 1 plaid maroon bag.
dull magenta bags contain 4 dark olive bags, 3 faded olive bags.
faded brown bags contain 4 light yellow bags, 3 drab red bags.
bright crimson bags contain 4 posh lime bags, 1 mirrored gray bag, 5 pale indigo bags.
bright lime bags contain 3 faded violet bags.
dotted white bags contain 2 pale fuchsia bags, 4 light red bags, 3 dull gold bags, 1 wavy salmon bag.
dull cyan bags contain 2 dark indigo bags, 5 muted black bags, 4 wavy aqua bags.
light plum bags contain 4 wavy beige bags, 2 clear crimson bags, 5 striped beige bags.
wavy chartreuse bags contain 1 dark indigo bag.
clear cyan bags contain 1 mirrored lime bag, 4 light silver bags.
striped salmon bags contain 3 dotted silver bags, 1 shiny turquoise bag, 3 mirrored tan bags.
bright cyan bags contain 1 wavy tomato bag, 4 dotted yellow bags, 2 pale tan bags.
muted red bags contain 2 vibrant chartreuse bags, 1 dim indigo bag, 5 muted aqua bags.
mirrored plum bags contain 1 light black bag, 3 vibrant brown bags.
mirrored lime bags contain 5 bright violet bags, 4 light maroon bags, 1 dotted beige bag, 2 plaid maroon bags.
dotted chartreuse bags contain 5 light black bags, 3 shiny turquoise bags, 5 drab lavender bags, 3 shiny silver bags.
plaid brown bags contain 2 drab gold bags, 5 clear cyan bags, 2 drab gray bags, 2 vibrant magenta bags.
clear olive bags contain 5 shiny cyan bags, 1 dark teal bag, 3 striped bronze bags, 2 striped olive bags.
light beige bags contain 5 pale plum bags.
dark cyan bags contain 5 posh tomato bags, 3 clear magenta bags, 2 shiny olive bags.
dark maroon bags contain 1 shiny turquoise bag, 2 dotted brown bags, 3 dark lime bags.
vibrant teal bags contain 2 pale purple bags.
dotted turquoise bags contain 5 vibrant magenta bags, 3 dark chartreuse bags.
dark red bags contain 2 striped chartreuse bags.
pale purple bags contain 4 drab gold bags, 1 drab violet bag, 3 muted black bags.
vibrant fuchsia bags contain 2 shiny purple bags.
dotted gold bags contain 2 shiny gold bags, 2 plaid coral bags.
striped aqua bags contain 3 dark chartreuse bags.
light orange bags contain 1 plaid red bag, 3 wavy salmon bags, 4 dotted indigo bags.
dotted lavender bags contain 4 dotted tomato bags, 3 plaid cyan bags.
light bronze bags contain 3 drab purple bags, 4 dotted crimson bags, 1 posh bronze bag.
dim tomato bags contain 4 dotted tan bags, 2 vibrant brown bags, 5 vibrant orange bags, 2 dotted silver bags.
striped plum bags contain 4 wavy indigo bags, 5 dim indigo bags, 3 vibrant green bags.
clear beige bags contain 3 muted bronze bags.
shiny coral bags contain 2 posh silver bags.
dull violet bags contain 5 bright teal bags, 3 plaid violet bags, 3 drab turquoise bags, 3 dull maroon bags.
posh yellow bags contain 2 light maroon bags, 3 light fuchsia bags, 1 shiny indigo bag.
dark tan bags contain 3 plaid yellow bags, 2 striped salmon bags.
shiny fuchsia bags contain 2 faded red bags, 3 dim violet bags, 4 wavy crimson bags.
clear purple bags contain 3 shiny chartreuse bags.
dim turquoise bags contain 5 vibrant magenta bags, 2 striped tomato bags.
light turquoise bags contain 5 wavy crimson bags, 3 dim beige bags, 2 bright teal bags, 3 posh maroon bags.
mirrored magenta bags contain 1 shiny turquoise bag.
clear blue bags contain 3 dark black bags, 4 faded fuchsia bags.
muted gray bags contain 1 light chartreuse bag.
wavy maroon bags contain 4 bright magenta bags, 1 vibrant orange bag.
shiny silver bags contain 4 dull white bags, 5 striped aqua bags.
clear silver bags contain 3 vibrant coral bags, 4 light gray bags, 4 shiny maroon bags.
wavy magenta bags contain 5 clear red bags, 4 shiny yellow bags, 2 dark green bags, 1 shiny cyan bag.
dull green bags contain 2 vibrant salmon bags.
wavy red bags contain 4 bright indigo bags.
wavy turquoise bags contain 4 clear gray bags, 4 dark chartreuse bags, 4 dark lavender bags.
faded tomato bags contain 5 wavy salmon bags, 1 muted salmon bag, 2 muted black bags.
dark orange bags contain 3 dim red bags, 3 dim silver bags, 2 muted beige bags, 5 bright silver bags.
shiny tomato bags contain 3 bright green bags, 3 dark blue bags, 2 wavy chartreuse bags.
clear fuchsia bags contain 2 dotted tan bags, 4 posh plum bags, 3 light green bags, 4 drab crimson bags.
pale tomato bags contain 3 faded bronze bags.
dull coral bags contain 5 plaid magenta bags, 1 mirrored cyan bag, 1 dark black bag.
pale gray bags contain 1 bright tan bag.
drab olive bags contain 2 posh blue bags, 1 dim salmon bag, 3 posh orange bags, 5 posh maroon bags.
plaid beige bags contain 3 muted olive bags, 2 drab fuchsia bags.
dotted coral bags contain 2 dark magenta bags.
bright magenta bags contain no other bags.
striped violet bags contain 1 plaid gray bag, 5 dull white bags, 3 dark indigo bags, 1 shiny orange bag.
plaid tomato bags contain 1 dotted orange bag, 5 bright silver bags.
wavy silver bags contain no other bags.
wavy bronze bags contain 5 plaid beige bags, 5 dark coral bags, 5 vibrant orange bags.
clear black bags contain 3 wavy beige bags.
drab teal bags contain 5 dull gray bags, 1 light yellow bag, 3 drab indigo bags, 1 bright maroon bag.
dim lavender bags contain 4 shiny lavender bags.
pale olive bags contain 4 wavy olive bags, 4 faded olive bags.
shiny turquoise bags contain 5 clear magenta bags, 1 mirrored aqua bag, 2 light lime bags, 2 dark indigo bags.
clear brown bags contain 1 dotted fuchsia bag, 4 clear white bags.
pale red bags contain 4 clear beige bags.
bright maroon bags contain 4 clear black bags, 2 vibrant white bags.
pale teal bags contain 3 pale silver bags, 2 wavy tomato bags.
plaid orange bags contain 5 shiny magenta bags.
posh plum bags contain 2 clear beige bags, 5 faded silver bags, 5 drab beige bags, 4 dim crimson bags.
pale maroon bags contain 1 posh maroon bag, 4 wavy magenta bags.
shiny black bags contain 1 dotted tomato bag, 1 mirrored silver bag, 5 plaid maroon bags, 5 clear salmon bags.
shiny lavender bags contain 5 muted bronze bags.
wavy violet bags contain 2 dotted tomato bags, 5 bright black bags, 4 clear cyan bags.
dotted tan bags contain 4 plaid teal bags.
drab tomato bags contain 5 dark black bags.
dull olive bags contain 1 clear salmon bag.
faded orange bags contain 2 light maroon bags, 3 posh lime bags, 4 dotted tan bags.
plaid purple bags contain 5 drab aqua bags, 3 clear plum bags, 2 pale purple bags.
wavy fuchsia bags contain 3 faded orange bags, 1 muted purple bag.
pale white bags contain 5 dark indigo bags, 1 pale tan bag.
bright olive bags contain 1 dull lime bag, 3 light fuchsia bags.
drab black bags contain 4 muted violet bags, 2 vibrant violet bags.
drab lime bags contain 5 dark brown bags, 5 striped indigo bags.
striped green bags contain 5 vibrant green bags, 3 striped silver bags, 2 dull turquoise bags, 4 drab indigo bags.
wavy olive bags contain 3 mirrored gray bags, 1 light lime bag, 2 bright indigo bags.
posh indigo bags contain 2 dotted fuchsia bags, 3 dotted purple bags, 2 wavy brown bags, 2 dotted blue bags.
clear crimson bags contain 5 drab gray bags, 2 plaid beige bags, 4 dark gold bags, 2 pale chartreuse bags.
pale lime bags contain 1 dotted plum bag, 2 vibrant maroon bags.
pale gold bags contain 4 posh tomato bags.
posh tomato bags contain 4 mirrored lime bags.
muted indigo bags contain 5 wavy fuchsia bags, 3 clear orange bags, 3 shiny green bags.
clear green bags contain 3 drab salmon bags, 4 pale turquoise bags.
mirrored yellow bags contain 5 dim red bags.
pale bronze bags contain 1 dotted chartreuse bag, 1 drab teal bag, 4 shiny cyan bags, 5 faded brown bags.
shiny maroon bags contain 2 wavy turquoise bags, 5 light turquoise bags, 5 wavy cyan bags.
dark magenta bags contain 4 mirrored lime bags, 3 drab aqua bags, 4 bright blue bags, 2 posh silver bags.
drab gold bags contain 2 light gray bags, 3 bright magenta bags, 2 vibrant magenta bags, 4 light lime bags.
drab brown bags contain 2 wavy salmon bags, 5 posh plum bags, 4 shiny orange bags.
dull gray bags contain 2 dim violet bags.
muted magenta bags contain 5 posh lavender bags, 2 dotted orange bags, 4 pale turquoise bags.
vibrant bronze bags contain 5 dim blue bags, 3 mirrored silver bags.
pale crimson bags contain 2 dark coral bags.
dotted cyan bags contain 2 clear salmon bags, 4 dark white bags.
light white bags contain 5 clear silver bags, 4 clear olive bags.
dim coral bags contain 3 drab silver bags, 5 shiny teal bags, 4 faded bronze bags, 4 muted plum bags.
dotted beige bags contain 1 light yellow bag, 4 light lime bags.
faded turquoise bags contain 4 dotted tomato bags, 3 pale magenta bags, 2 dim brown bags.
shiny brown bags contain 5 faded red bags.
striped yellow bags contain 3 mirrored crimson bags, 4 dark magenta bags, 3 pale crimson bags, 2 mirrored black bags.
shiny magenta bags contain 1 vibrant tomato bag, 3 mirrored lavender bags.
clear indigo bags contain 4 muted tomato bags, 3 posh red bags, 5 pale turquoise bags, 3 dim olive bags.
striped silver bags contain 4 drab maroon bags, 2 drab chartreuse bags, 2 dotted gray bags.
mirrored black bags contain 1 wavy beige bag, 1 dim silver bag.
faded cyan bags contain 3 dim crimson bags, 3 drab aqua bags.
posh lavender bags contain 2 light gray bags, 1 dim orange bag.
dim violet bags contain 2 posh maroon bags, 4 clear salmon bags.
plaid tan bags contain 5 shiny indigo bags, 1 shiny fuchsia bag.
posh maroon bags contain 5 dark magenta bags, 1 drab silver bag, 5 drab red bags.
striped turquoise bags contain 1 dull lime bag.
wavy tomato bags contain 3 dotted gray bags, 5 dull blue bags, 3 dotted purple bags.
drab fuchsia bags contain 5 drab red bags, 2 mirrored lime bags.
dotted green bags contain 5 posh turquoise bags.
pale chartreuse bags contain 1 striped beige bag, 5 dark chartreuse bags.
plaid cyan bags contain 3 drab gold bags, 1 light gray bag, 2 bright violet bags, 3 dark chartreuse bags.
dull blue bags contain 4 dotted yellow bags.
vibrant crimson bags contain 1 dotted beige bag.
light crimson bags contain 2 light black bags, 2 dotted beige bags.
posh turquoise bags contain 1 posh lavender bag, 4 vibrant orange bags, 4 shiny lavender bags.
dull beige bags contain 5 dull salmon bags.
shiny orange bags contain 5 drab gray bags, 1 plaid chartreuse bag, 5 dim crimson bags.
muted crimson bags contain 3 light cyan bags, 3 dull fuchsia bags, 2 bright red bags.
shiny gray bags contain 2 bright fuchsia bags, 5 vibrant maroon bags, 1 bright teal bag, 3 striped magenta bags.
bright brown bags contain 3 mirrored violet bags, 1 light aqua bag, 5 bright maroon bags.
faded teal bags contain 5 faded gray bags, 5 pale indigo bags, 5 plaid cyan bags.
faded violet bags contain 1 shiny fuchsia bag, 5 faded gray bags.
striped purple bags contain 2 wavy olive bags.
muted tan bags contain 1 clear red bag, 1 shiny crimson bag, 3 faded violet bags.
light chartreuse bags contain 5 faded turquoise bags.
mirrored bronze bags contain 4 wavy indigo bags.
plaid turquoise bags contain 5 pale aqua bags, 4 faded indigo bags.
drab aqua bags contain 1 light silver bag, 2 plaid bronze bags, 2 light black bags, 3 muted bronze bags.
posh red bags contain 5 faded aqua bags, 2 posh coral bags, 5 light lime bags, 3 faded gray bags.
bright aqua bags contain 5 faded orange bags, 2 bright silver bags, 1 posh fuchsia bag, 3 pale blue bags.
faded yellow bags contain 1 mirrored olive bag.
faded red bags contain 4 drab gold bags, 5 shiny turquoise bags.
wavy gray bags contain 1 dull salmon bag, 5 posh brown bags, 1 drab bronze bag.
striped fuchsia bags contain 3 faded tan bags, 5 posh turquoise bags, 2 dotted turquoise bags.
vibrant chartreuse bags contain 2 posh lavender bags, 1 plaid cyan bag, 3 muted brown bags.
faded chartreuse bags contain 4 drab gold bags, 3 faded gray bags.
dim chartreuse bags contain 3 dark maroon bags, 5 dim brown bags.
clear plum bags contain 2 dotted indigo bags, 5 dark white bags, 3 plaid indigo bags, 5 bright beige bags.
faded gold bags contain 4 dim beige bags, 3 light maroon bags, 4 vibrant brown bags, 3 muted olive bags.
dull fuchsia bags contain 5 dark white bags, 3 pale magenta bags, 1 bright blue bag, 3 drab salmon bags.
bright yellow bags contain 1 clear indigo bag, 5 dark white bags, 4 shiny indigo bags, 5 light orange bags.
faded aqua bags contain 3 drab red bags, 1 muted olive bag, 3 vibrant green bags.
shiny red bags contain 4 faded chartreuse bags, 1 plaid salmon bag, 5 clear crimson bags.
vibrant salmon bags contain 2 drab magenta bags.
vibrant plum bags contain 5 drab maroon bags, 3 plaid coral bags.
dull black bags contain 3 posh indigo bags, 4 light gray bags, 3 wavy salmon bags.
muted black bags contain 1 faded salmon bag, 4 dark blue bags.
dim cyan bags contain 1 posh salmon bag, 5 bright teal bags, 3 shiny olive bags.
posh blue bags contain 3 bright magenta bags, 4 light black bags, 2 vibrant orange bags.
light silver bags contain 2 shiny yellow bags.
drab coral bags contain 1 shiny chartreuse bag, 1 pale blue bag.
drab blue bags contain 1 bright lavender bag, 3 vibrant violet bags, 5 shiny yellow bags.
bright bronze bags contain 5 posh tomato bags, 5 plaid beige bags.
faded gray bags contain 1 vibrant brown bag, 3 posh lavender bags.
dark plum bags contain 3 dull bronze bags, 3 light coral bags.
light yellow bags contain 3 drab silver bags.
dim aqua bags contain 4 wavy beige bags, 5 light maroon bags.
dim orange bags contain no other bags.
light olive bags contain 5 pale olive bags, 5 pale violet bags.
shiny indigo bags contain 4 plaid brown bags, 1 vibrant teal bag, 4 light black bags, 3 faded bronze bags.
light teal bags contain 5 dull cyan bags, 2 dim salmon bags.
dotted aqua bags contain 4 bright orange bags, 3 drab fuchsia bags, 3 dotted gray bags.
pale beige bags contain 3 wavy maroon bags.
posh lime bags contain 3 striped chartreuse bags, 4 drab gold bags, 3 light gray bags, 3 dim lavender bags.
mirrored silver bags contain 1 wavy salmon bag, 2 drab yellow bags, 2 dotted gray bags.
muted bronze bags contain 5 vibrant magenta bags, 4 light gray bags, 4 light lime bags.
bright violet bags contain no other bags.
dotted fuchsia bags contain 1 dark indigo bag, 4 vibrant brown bags, 4 plaid olive bags, 5 muted olive bags.
posh tan bags contain 4 plaid beige bags, 4 dark indigo bags.
faded tan bags contain 4 bright tan bags, 4 mirrored plum bags, 5 striped tomato bags.
plaid fuchsia bags contain 1 wavy purple bag, 4 shiny teal bags, 3 shiny plum bags, 2 wavy white bags.
pale silver bags contain 3 plaid green bags, 3 drab chartreuse bags, 4 posh bronze bags.
plaid yellow bags contain 1 pale aqua bag, 2 drab chartreuse bags.
dark gold bags contain 3 wavy salmon bags.
mirrored tan bags contain 3 bright violet bags.
dotted crimson bags contain 3 dark magenta bags, 1 posh tomato bag.
bright beige bags contain 2 dark indigo bags, 5 dotted beige bags, 1 drab beige bag, 3 striped aqua bags.
plaid teal bags contain 1 dotted gold bag, 1 posh bronze bag.
vibrant magenta bags contain no other bags.
clear tomato bags contain 5 pale indigo bags.
light violet bags contain 5 drab indigo bags, 1 pale violet bag, 5 drab purple bags, 2 vibrant tomato bags.
pale salmon bags contain 2 posh plum bags.
plaid gray bags contain 1 vibrant gray bag, 1 bright gold bag.
muted blue bags contain 1 shiny white bag, 4 pale teal bags, 4 dim crimson bags, 4 vibrant chartreuse bags.
muted aqua bags contain 5 wavy teal bags.
dim teal bags contain 4 plaid blue bags.
dim olive bags contain 4 dim silver bags, 1 faded brown bag.
posh coral bags contain 3 striped blue bags, 2 plaid olive bags, 3 plaid teal bags, 3 clear beige bags.
wavy lime bags contain 4 dull green bags, 1 posh maroon bag, 5 dotted lavender bags.
dark chartreuse bags contain no other bags.
dotted yellow bags contain 5 bright magenta bags.
light fuchsia bags contain 1 plaid coral bag, 1 posh silver bag, 3 light orange bags.
dark purple bags contain 2 plaid bronze bags, 3 posh chartreuse bags, 1 light magenta bag.
striped tan bags contain 1 clear black bag, 1 posh blue bag, 4 faded salmon bags.
vibrant tan bags contain 1 pale red bag, 2 dull lime bags, 4 posh plum bags.
bright turquoise bags contain 4 drab aqua bags, 5 dull blue bags.
dull purple bags contain 1 striped fuchsia bag, 3 dark lavender bags.
light purple bags contain 3 bright blue bags, 5 mirrored beige bags, 2 muted beige bags.
plaid aqua bags contain 4 dotted indigo bags, 1 muted aqua bag.
shiny tan bags contain 3 pale magenta bags, 5 drab salmon bags, 2 dotted gold bags.
light brown bags contain 5 posh tomato bags, 1 light gray bag, 1 bright gold bag, 4 posh violet bags.
posh bronze bags contain 2 light black bags, 5 dim lavender bags.
dim red bags contain no other bags.
pale yellow bags contain 3 bright tan bags, 3 plaid magenta bags.
dim salmon bags contain 4 dark white bags, 5 dotted brown bags, 1 striped aqua bag.
muted green bags contain 4 dim brown bags, 3 posh tan bags, 4 shiny olive bags, 4 clear fuchsia bags.
drab maroon bags contain 4 dull olive bags, 2 dotted black bags.
dotted black bags contain 2 dotted fuchsia bags, 3 dim aqua bags, 4 light orange bags, 5 light red bags.
striped lime bags contain 1 clear crimson bag.
dim gray bags contain 4 striped lavender bags, 1 wavy salmon bag, 3 posh violet bags, 3 dotted brown bags.
drab red bags contain 2 dim brown bags, 4 light lime bags.
muted olive bags contain 1 dark coral bag, 2 wavy silver bags, 5 drab silver bags, 5 pale fuchsia bags.
shiny crimson bags contain 5 light crimson bags, 2 clear magenta bags.
vibrant green bags contain 4 light orange bags.
wavy purple bags contain 5 dull brown bags.
mirrored indigo bags contain 3 clear bronze bags, 1 pale tan bag, 1 faded tomato bag.
dull white bags contain 3 dim beige bags, 2 light yellow bags, 2 dark indigo bags, 2 muted bronze bags.
bright tan bags contain 2 posh blue bags, 3 striped chartreuse bags.
mirrored olive bags contain 1 wavy maroon bag, 5 wavy silver bags, 5 shiny beige bags.
faded white bags contain 4 bright bronze bags, 1 plaid brown bag, 5 vibrant yellow bags, 2 drab indigo bags.
muted teal bags contain 2 striped crimson bags, 1 dim orange bag, 5 posh green bags.
faded coral bags contain 1 dim beige bag, 1 striped brown bag, 4 pale indigo bags, 1 posh fuchsia bag.
dim green bags contain 3 dark maroon bags, 4 striped chartreuse bags, 1 wavy purple bag.
wavy gold bags contain 3 clear aqua bags, 2 dim orange bags.
dotted purple bags contain 4 dotted indigo bags, 4 drab aqua bags, 2 dark coral bags, 3 muted beige bags.
dark beige bags contain 5 shiny fuchsia bags.
posh fuchsia bags contain 3 vibrant white bags.
mirrored maroon bags contain 3 dull white bags, 2 plaid gold bags, 4 plaid maroon bags, 2 bright crimson bags.
dim tan bags contain 1 dark white bag, 5 posh black bags, 3 plaid brown bags, 1 posh bronze bag.
posh purple bags contain 5 clear tomato bags.
dark tomato bags contain 1 posh lime bag.
dim gold bags contain 1 posh salmon bag, 5 dark red bags, 4 dark black bags, 2 faded orange bags.
plaid white bags contain 2 clear olive bags, 2 mirrored cyan bags, 3 muted white bags.
dull brown bags contain 5 plaid tomato bags, 2 dotted black bags.
light gold bags contain 3 plaid gold bags, 4 posh salmon bags, 2 dotted blue bags, 5 dull gray bags.
dark silver bags contain 2 light gray bags, 3 dotted fuchsia bags, 2 light red bags.
plaid green bags contain 4 light maroon bags, 1 striped tomato bag, 4 drab beige bags.
dull turquoise bags contain 2 light maroon bags, 3 posh silver bags, 5 dim lavender bags, 5 vibrant orange bags.
dark violet bags contain 3 wavy maroon bags, 1 clear salmon bag, 5 light yellow bags.
wavy brown bags contain 3 dim white bags.
faded magenta bags contain 3 dark silver bags, 4 vibrant purple bags, 1 dark white bag.
muted cyan bags contain 5 shiny beige bags, 3 muted white bags.
mirrored chartreuse bags contain 3 mirrored maroon bags, 2 faded indigo bags, 1 pale red bag.
mirrored turquoise bags contain 1 drab gold bag.
shiny purple bags contain 3 faded yellow bags, 2 pale aqua bags, 5 vibrant red bags.
faded lavender bags contain 2 dim gray bags, 3 dim blue bags, 4 dark black bags.
dotted blue bags contain 2 posh lime bags, 1 dotted beige bag, 4 mirrored aqua bags.
wavy cyan bags contain 3 dotted turquoise bags, 2 dark lime bags, 4 dotted crimson bags, 1 dotted lime bag.
faded lime bags contain 1 faded bronze bag, 5 dotted purple bags, 4 light orange bags.
striped red bags contain 1 shiny teal bag.
light indigo bags contain 5 shiny olive bags, 4 dim magenta bags, 5 plaid magenta bags, 5 dark violet bags.
wavy yellow bags contain 3 bright aqua bags, 1 dull blue bag, 1 bright olive bag.
posh beige bags contain 2 posh orange bags, 3 dotted olive bags, 3 dull yellow bags, 1 wavy white bag.
muted turquoise bags contain 4 bright silver bags, 4 wavy silver bags.
drab purple bags contain 5 bright tan bags.
vibrant lime bags contain 3 plaid magenta bags, 2 vibrant white bags, 2 dark gold bags, 1 light green bag.
clear violet bags contain 3 muted red bags, 4 posh yellow bags, 2 pale indigo bags.
pale fuchsia bags contain 2 wavy beige bags, 2 plaid bronze bags, 2 wavy silver bags.
plaid black bags contain 4 pale olive bags, 3 pale fuchsia bags.
vibrant violet bags contain 1 plaid red bag, 5 drab red bags, 5 pale gray bags.
mirrored crimson bags contain 1 dotted fuchsia bag.
posh aqua bags contain 3 plaid teal bags.
shiny teal bags contain 4 dotted black bags.
drab orange bags contain 5 dotted teal bags, 4 drab white bags, 3 pale olive bags.
posh chartreuse bags contain 3 drab gray bags.
plaid indigo bags contain 2 striped tomato bags.
plaid lime bags contain 5 drab purple bags.
dull tomato bags contain 2 wavy turquoise bags.
wavy black bags contain 5 mirrored blue bags, 5 striped tan bags.
posh brown bags contain 3 wavy purple bags, 1 mirrored violet bag.
dim purple bags contain 5 clear gray bags, 1 plaid green bag, 3 light green bags.
dotted indigo bags contain 4 drab silver bags.
striped cyan bags contain 5 light orange bags, 1 dim chartreuse bag, 1 bright blue bag, 5 dim coral bags.
striped brown bags contain 1 light turquoise bag, 1 mirrored coral bag.
wavy salmon bags contain 2 vibrant orange bags, 2 drab silver bags, 3 bright blue bags, 1 vibrant brown bag.
drab lavender bags contain 5 dotted fuchsia bags, 1 plaid green bag, 4 posh salmon bags.
drab silver bags contain 4 muted bronze bags, 2 drab gold bags.
plaid maroon bags contain 1 vibrant brown bag, 4 shiny yellow bags, 3 bright blue bags, 5 drab gold bags.
vibrant beige bags contain 2 drab indigo bags, 2 dim aqua bags.
mirrored green bags contain 1 dim coral bag, 5 muted orange bags, 1 dotted purple bag.
drab indigo bags contain 4 dotted magenta bags, 3 drab lavender bags, 4 dotted lime bags, 5 wavy aqua bags.
faded black bags contain 4 plaid gold bags.
muted violet bags contain 2 drab aqua bags, 2 light crimson bags, 2 posh tomato bags.
posh orange bags contain 3 shiny salmon bags.
bright gray bags contain 1 mirrored gray bag, 3 mirrored magenta bags, 1 clear salmon bag.
plaid plum bags contain 3 striped magenta bags, 1 drab fuchsia bag.
posh black bags contain 5 dotted orange bags, 2 muted beige bags.
striped maroon bags contain 5 clear gold bags, 5 clear tomato bags, 4 muted cyan bags, 1 pale coral bag.
dim indigo bags contain 1 shiny lavender bag, 2 posh blue bags, 3 drab silver bags.
clear magenta bags contain 3 dark magenta bags, 2 drab gold bags, 4 dull white bags, 5 light maroon bags.
plaid red bags contain 4 drab violet bags, 4 vibrant brown bags.
light gray bags contain no other bags.
clear red bags contain 3 drab purple bags, 2 pale magenta bags, 2 bright violet bags.
pale coral bags contain 5 muted chartreuse bags, 4 plaid olive bags.
dull red bags contain 4 drab lavender bags, 5 bright orange bags, 5 dull white bags.
clear lavender bags contain 4 wavy brown bags, 1 faded bronze bag.
dim beige bags contain 3 dotted tomato bags, 4 bright magenta bags.
striped orange bags contain 4 vibrant lime bags, 1 vibrant tomato bag, 1 faded plum bag.
drab beige bags contain 1 light lime bag, 1 shiny lavender bag, 2 striped tomato bags, 1 dim orange bag.
mirrored tomato bags contain 2 posh bronze bags.
mirrored violet bags contain 3 dotted lime bags, 2 dotted teal bags.
muted silver bags contain 1 bright salmon bag, 3 shiny crimson bags, 1 dim tomato bag.
clear gold bags contain 1 dark violet bag.
faded beige bags contain 1 dull fuchsia bag, 4 shiny yellow bags.
mirrored red bags contain 5 wavy lavender bags, 2 wavy silver bags.
wavy coral bags contain 4 drab yellow bags.
shiny yellow bags contain 1 shiny lavender bag, 5 drab silver bags, 4 drab gold bags.
shiny chartreuse bags contain 5 faded brown bags.
light black bags contain 1 plaid cyan bag, 5 dark chartreuse bags, 5 muted bronze bags.
bright blue bags contain 3 drab silver bags, 5 dim orange bags.
mirrored gray bags contain 4 pale indigo bags.
shiny gold bags contain 1 dim lavender bag, 5 mirrored gray bags, 1 light maroon bag.
faded plum bags contain 2 shiny orange bags, 1 pale plum bag, 2 posh coral bags, 3 shiny white bags.
dotted olive bags contain 1 drab aqua bag, 4 posh black bags, 3 pale salmon bags, 2 dotted yellow bags.
vibrant tomato bags contain 3 muted brown bags, 4 faded teal bags, 4 dotted brown bags.
vibrant yellow bags contain 1 drab coral bag, 3 dark purple bags, 1 wavy crimson bag.
muted coral bags contain 1 dark plum bag, 3 wavy blue bags, 3 bright yellow bags, 4 dark maroon bags.
dark white bags contain 1 dim brown bag, 2 drab gray bags, 3 clear cyan bags.
light salmon bags contain 4 dim violet bags, 2 shiny gold bags, 5 pale turquoise bags.
dark green bags contain 1 pale yellow bag, 5 shiny gold bags.
dark lime bags contain 2 plaid red bags, 4 dotted tomato bags, 4 posh bronze bags.
light tan bags contain 5 light coral bags.
striped gold bags contain 3 vibrant maroon bags, 4 clear lime bags.
dotted silver bags contain 3 striped aqua bags, 2 mirrored aqua bags, 1 vibrant brown bag.
dull aqua bags contain 4 pale gray bags, 4 mirrored cyan bags, 2 shiny turquoise bags, 5 striped crimson bags.
shiny plum bags contain 2 plaid green bags, 3 light crimson bags.
faded indigo bags contain 5 light tomato bags, 3 pale indigo bags, 1 shiny magenta bag, 5 muted tomato bags.
striped blue bags contain 2 shiny crimson bags, 3 wavy crimson bags, 4 dotted red bags.
muted salmon bags contain 1 faded red bag, 1 dim gray bag, 2 dotted gray bags.
pale aqua bags contain 5 clear magenta bags, 3 dim beige bags.
pale plum bags contain 5 bright indigo bags, 2 light crimson bags, 1 muted white bag.
pale green bags contain 5 bright aqua bags, 1 dull fuchsia bag.
wavy tan bags contain 2 posh tomato bags.
wavy teal bags contain 2 mirrored violet bags.
dim maroon bags contain 3 drab fuchsia bags.
bright silver bags contain 5 dull black bags.
plaid magenta bags contain 2 muted olive bags, 5 mirrored plum bags, 1 posh lavender bag.
wavy lavender bags contain 3 pale salmon bags, 4 wavy green bags, 5 posh yellow bags.
striped olive bags contain 2 pale fuchsia bags, 1 pale silver bag, 4 dull brown bags, 4 dim blue bags.
shiny cyan bags contain 2 light tomato bags, 2 faded indigo bags, 3 drab lime bags.
bright white bags contain 4 dark orange bags.
mirrored lavender bags contain 3 drab gold bags, 4 mirrored white bags, 4 bright orange bags, 1 pale gray bag.
dark brown bags contain 1 dark chartreuse bag, 2 muted bronze bags, 3 bright magenta bags, 5 striped chartreuse bags.
dark blue bags contain 5 vibrant brown bags, 4 drab maroon bags, 5 wavy brown bags, 3 drab silver bags.
bright gold bags contain 5 dark silver bags.
dotted gray bags contain 1 posh bronze bag, 5 drab fuchsia bags, 3 mirrored gray bags, 1 clear cyan bag.
clear teal bags contain 1 dim beige bag.
drab yellow bags contain 3 bright blue bags.
bright purple bags contain 2 posh lavender bags.
shiny bronze bags contain 1 faded red bag.
dark black bags contain 2 mirrored beige bags, 3 wavy silver bags.
mirrored coral bags contain 3 drab beige bags, 3 wavy silver bags, 4 dim lavender bags, 4 drab silver bags.
dim white bags contain 4 posh bronze bags.
dim brown bags contain 1 muted bronze bag, 2 drab gold bags, 4 striped tomato bags, 5 drab silver bags.
striped white bags contain 1 dotted crimson bag, 4 pale indigo bags, 2 dark chartreuse bags, 1 dotted brown bag.
dark coral bags contain 2 dark brown bags, 4 mirrored plum bags, 4 bright tan bags, 5 posh blue bags.
faded bronze bags contain 4 drab fuchsia bags, 1 plaid yellow bag.
dim fuchsia bags contain 3 plaid yellow bags, 1 wavy coral bag, 2 dotted blue bags.
mirrored blue bags contain 5 dull crimson bags, 1 pale chartreuse bag, 3 vibrant plum bags.
wavy plum bags contain 1 pale olive bag, 1 bright red bag, 3 clear tan bags, 2 drab gray bags.
plaid bronze bags contain 5 wavy silver bags, 4 bright magenta bags, 1 dim orange bag.
dotted tomato bags contain 1 vibrant brown bag, 5 mirrored gray bags.
dim yellow bags contain 1 vibrant teal bag, 5 plaid white bags.
faded olive bags contain 4 wavy beige bags.
bright coral bags contain 2 muted maroon bags, 2 posh indigo bags.
mirrored aqua bags contain 1 light gray bag.
faded blue bags contain 1 vibrant tomato bag, 1 mirrored salmon bag.
mirrored fuchsia bags contain 5 plaid beige bags, 5 clear violet bags.
bright orange bags contain 3 dull turquoise bags, 3 striped blue bags, 3 posh maroon bags, 5 dotted brown bags.
drab white bags contain 5 drab maroon bags, 3 shiny coral bags, 1 drab gray bag.
plaid blue bags contain 5 light turquoise bags, 4 dark violet bags, 1 bright indigo bag, 3 dull fuchsia bags.
bright tomato bags contain 4 vibrant tomato bags, 1 dull purple bag, 4 clear tomato bags, 2 dotted yellow bags.
dark gray bags contain 3 light green bags, 3 dull teal bags, 2 wavy chartreuse bags, 1 vibrant coral bag.
light lime bags contain no other bags.
dim magenta bags contain 2 light gold bags, 4 dotted teal bags, 3 dull crimson bags.
vibrant cyan bags contain 2 dark brown bags, 1 dim crimson bag.
dotted salmon bags contain 2 shiny magenta bags, 4 dark orange bags, 3 striped lavender bags, 3 mirrored violet bags.
plaid chartreuse bags contain 3 dull crimson bags, 1 dull red bag, 4 posh white bags, 5 bright indigo bags.
muted plum bags contain 1 clear salmon bag, 3 mirrored lime bags.
dark bronze bags contain 4 clear chartreuse bags.
dim blue bags contain 4 light yellow bags, 5 mirrored beige bags.
vibrant gold bags contain 4 muted bronze bags, 4 plaid gold bags.
drab gray bags contain 1 dark chartreuse bag.
dotted lime bags contain 1 dotted indigo bag, 4 dull gray bags, 3 drab gray bags, 4 shiny bronze bags.
mirrored orange bags contain 5 mirrored tan bags.
dark lavender bags contain 3 dim chartreuse bags, 4 posh black bags, 1 clear beige bag.
muted lime bags contain 1 vibrant violet bag.
dull indigo bags contain 3 faded indigo bags, 5 bright orange bags, 4 posh turquoise bags, 1 dim gray bag.
pale magenta bags contain 5 dotted gray bags, 3 drab silver bags, 2 wavy salmon bags.
plaid lavender bags contain 5 vibrant tomato bags.
clear bronze bags contain 3 shiny crimson bags.
bright salmon bags contain 5 mirrored bronze bags, 2 clear black bags, 4 plaid green bags, 5 faded red bags.
wavy indigo bags contain 3 shiny lavender bags, 3 vibrant brown bags, 2 dotted beige bags, 4 wavy brown bags.
light maroon bags contain 3 light black bags, 3 plaid maroon bags, 2 wavy silver bags, 5 vibrant brown bags.
muted gold bags contain 5 posh black bags.
dull lavender bags contain 3 plaid beige bags, 4 clear cyan bags, 5 striped aqua bags, 4 dotted gray bags.
muted brown bags contain 1 faded olive bag, 2 drab gray bags, 5 wavy salmon bags.
dotted orange bags contain 2 dotted red bags.
dim plum bags contain 5 drab lime bags, 1 plaid tan bag.
muted orange bags contain 3 plaid green bags.
dull chartreuse bags contain 4 dark maroon bags, 5 vibrant tan bags, 1 mirrored coral bag, 5 dull lime bags.
striped gray bags contain 2 vibrant crimson bags.
posh gray bags contain 3 dark orange bags.
shiny lime bags contain 4 muted yellow bags, 2 wavy cyan bags.
dull lime bags contain 1 drab purple bag.
striped bronze bags contain 2 dim white bags, 1 dim coral bag, 3 light maroon bags, 5 dim blue bags.
wavy orange bags contain 2 pale blue bags, 3 muted violet bags.
pale brown bags contain 3 wavy indigo bags, 1 bright green bag.
dull silver bags contain 5 wavy aqua bags, 5 shiny maroon bags, 5 dotted chartreuse bags.
bright red bags contain 2 dark gold bags, 5 dark tan bags.
dotted brown bags contain 1 striped turquoise bag.
plaid crimson bags contain 3 posh white bags, 4 pale plum bags, 3 dark orange bags, 3 shiny magenta bags.
dotted plum bags contain 5 posh blue bags, 5 dark indigo bags, 5 wavy silver bags.
light tomato bags contain 3 light purple bags, 5 clear plum bags.
dull bronze bags contain 3 clear magenta bags, 1 faded tan bag.
drab turquoise bags contain 2 posh lavender bags, 2 faded tomato bags, 5 mirrored tomato bags.
striped lavender bags contain 2 dotted turquoise bags, 5 plaid indigo bags.
pale violet bags contain 5 light red bags, 1 striped chartreuse bag, 1 drab chartreuse bag, 1 bright silver bag.
posh gold bags contain 2 bright blue bags.
dull maroon bags contain 4 dotted teal bags, 2 faded silver bags, 3 posh gray bags.
shiny beige bags contain 3 light orange bags, 4 drab fuchsia bags, 3 muted beige bags.
dim silver bags contain 1 dotted gold bag.
pale orange bags contain 5 dotted orange bags, 3 dim white bags.
wavy aqua bags contain 5 vibrant purple bags.
posh salmon bags contain 2 drab red bags.
clear tan bags contain 4 bright plum bags, 4 faded fuchsia bags, 1 mirrored crimson bag, 1 faded salmon bag.
clear orange bags contain 1 drab aqua bag.
posh violet bags contain 2 vibrant magenta bags, 3 mirrored plum bags, 5 light orange bags.
dull crimson bags contain 5 faded violet bags, 3 dim indigo bags, 2 light red bags, 2 clear red bags.
mirrored teal bags contain 1 drab teal bag.
drab violet bags contain 2 mirrored plum bags, 4 drab red bags.
shiny violet bags contain 5 shiny aqua bags, 1 striped brown bag, 1 dark blue bag, 5 wavy white bags.

44
day07/lib.go

@ -0,0 +1,44 @@
package day07
func canHoldType(bagType string, canHold string) bool {
for _, bag := range rows {
if bag.Type == bagType {
if bag.Carries[canHold] > 0 {
return true
}
if len(bag.Carries) > 0 {
canCarry := false
for carry := range bag.Carries {
if canHoldType(carry, canHold) {
canCarry = true
}
}
return canCarry
}
}
}
return false
}
func getRecursiveContents(bagType string) int {
for _, bag := range rows {
if bag.Type == bagType {
if len(bag.Carries) == 0 {
return 0
}
sum := 0
for carry, amount := range bag.Carries {
sum += amount + amount*getRecursiveContents(carry)
}
return sum
}
}
return 0
}

50
day07/parse.go

@ -0,0 +1,50 @@
package day07
import (
"regexp"
"strconv"
"strings"
"git.elis.nu/etu/aoc2020/utils"
)
type Bag struct {
Type string
Carries map[string]int
}
var rows []Bag
func ParseFile(input string) {
// Parse file
for _, line := range utils.GetLinesFromFile("day07/" + input + ".txt") {
re := regexp.MustCompile(`^([\s\w]+) bags contain no other bags.$`)
if match := re.FindStringSubmatch(line); len(match) > 0 {
rows = append(rows, Bag{
Type: match[1],
})
} else {
re = regexp.MustCompile(`^([\s\w]+) bags contain ([^\.]+).$`)
matches := re.FindStringSubmatch(line)
row := Bag{
Type: matches[1],
Carries: make(map[string]int),
}
for _, rule := range strings.Split(matches[2], ", ") {
re = regexp.MustCompile(`(\d+) ([\s\w]+) bags?`)
matches2 := re.FindStringSubmatch(rule)
amount, _ := strconv.Atoi(matches2[1])
row.Carries[matches2[2]] = amount
}
rows = append(rows, row)
}
}
}

17
day07/solve1.go

@ -0,0 +1,17 @@
package day07
import (
"log"
)
func Solve1() {
counter := 0
for _, row := range rows {
if canHoldType(row.Type, "shiny gold") {
counter++
}
}
log.Printf("2020-12-07.01: Answer: %d\n", counter)
}

11
day07/solve2.go

@ -0,0 +1,11 @@
package day07
import (
"log"
)
func Solve2() {
counter := getRecursiveContents("shiny gold")
log.Printf("2020-12-07.02: Answer: %d\n", counter)
}

4
main.go

@ -10,6 +10,7 @@ import (
"git.elis.nu/etu/aoc2020/day04"
"git.elis.nu/etu/aoc2020/day05"
"git.elis.nu/etu/aoc2020/day06"
"git.elis.nu/etu/aoc2020/day07"
"git.elis.nu/etu/aoc2020/utils"
)
@ -36,5 +37,8 @@ func main() {
case "day06":
utils.Perf("2020-12-06", day06.ParseFile, day06.Solve1, day06.Solve2)
case "day07":
utils.Perf("2020-12-07", day07.ParseFile, day07.Solve1, day07.Solve2)
}
}

Loading…
Cancel
Save