Пример #1
0
 public static int Part1(string input)
 {
     foreach (string line in input.Split(Environment.NewLine))
     {
         BagFactory.AddBag(line);
     }
     return(BagFactory.GetBag("shiny gold").CanBeHoldBy(null));
 }
Пример #2
0
 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));
 }