Example #1
0
        public static IEnumerable <int> TotalCoinsForEachCombination(RuntimeCoin c)
        {
            if (!c.Next.Any())
            {
                return new[] { c.NumCoins }
            }
            ;

            return(c.Next.SelectMany(TotalCoinsForEachCombination).Select(x => x + c.NumCoins));
        }
Example #2
0
 public static int NumCoinsForLeafNode(RuntimeCoin c)
 {
     return(c.NumCoins);
 }