public static int Part1(string input) { foreach (string line in input.Split(Environment.NewLine)) { BagFactory.AddBag(line); } return(BagFactory.GetBag("shiny gold").CanBeHoldBy(null)); }
public static int Part2(string input) { if (BagFactory.Bags.Count == 0) { foreach (string line in input.Split(Environment.NewLine)) { BagFactory.AddBag(line); } } return(BagFactory.GetBag("shiny gold").CanHold(1)); }