Exemple #1
0
        protected override int ComputeResultLogic(Graph <string> input)
        {
            var permittedBags = new List <string>();
            var shinyGoldNode = input.AllNodes.SingleOrDefault(n => n.Key == ShinyGoldBagName);

            Day7Helper.FindAncestors(shinyGoldNode.Value, permittedBags);

            return(permittedBags.Count);
        }
Exemple #2
0
        protected override long ComputeResultLogic(Graph <string> input)
        {
            var permittedBags = new List <string>();
            var shinyGoldNode = input.AllNodes.SingleOrDefault(n => n.Key == ShinyGoldBagName);

            Day7Helper.FindAncestors(shinyGoldNode.Value, permittedBags);
            var total = Day7Helper.ComputeTotalNumberOfChildrenBags(shinyGoldNode.Value, 1);

            return(total);
        }