예제 #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));
 }