You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dict([match(r"(\w+ \w+) bags contain", l).captures[1] =>Dict([m.captures[2] =>parse(Int, m.captures[1]) for m ineachmatch(r"(\d+) (\w+ \w+)", l)]) for l ineachline(file)])
end
key ="shiny gold"
functionadd!(all_bags, bag)
for (c, elems) in rules
if!in(all_bags, c) &&haskey(elems, bag)
push!(all_bags, c)
add!(all_bags, c)
end
end
all_bags
end
p1 =length(add!(Set(), key))
println("$p1")
functioncontains(bag, cost)::Int
cost * (1+sum([contains(c, num) for (c, num) in rules[bag]]))