Example #1
0
        public override string Solve()
        {
            var bagRegulations = BagRegulation
                                 .GetBagRegulations(ParserFactory.CreateMultiLineStringParser().GetData())
                                 .ToArray();

            var regulationLookup = BagRegulation.GetRegulationsLookup(bagRegulations);

            return(bagRegulations
                   .Count(r => r.CanContainBag("shiny gold", regulationLookup))
                   .ToString());
        }
Example #2
0
        public override string Solve()
        {
            var regulationLookup = BagRegulation.GetRegulationsLookup(ParserFactory.CreateMultiLineStringParser().GetData());

            return(regulationLookup["shiny gold"].ContainedBagCount(regulationLookup).ToString());
        }