コード例 #1
0
    public static void Part2(List <int> sizes)
    {
        var validCombos     = AOC.Combinations <int>(sizes).Where(combo => combo.Sum() == 150);
        int minCount        = validCombos.Select(combo => combo.Count()).Min();
        int sameCountCombos = validCombos.Where(combo => combo.Count() == minCount).Count();

        Console.WriteLine(sameCountCombos);
    }
コード例 #2
0
    public static void Part1(List <int> sizes)
    {
        int combinations = AOC.Combinations <int>(sizes).Where(combo => combo.Sum() == 150).Count();

        Console.WriteLine(combinations);
    }