Пример #1
0
        public void Day04a()
        {
            var input  = File.ReadAllText(".\\Content\\Day04.txt");
            var output = GuardCalculator.GetSleepiestGuard(input);

            output.Should().Be(73646);
        }
Пример #2
0
        public void Day04a_Test()
        {
            var input  = "[1518-11-01 00:00] Guard #10 begins shift\r\n[1518-11-01 00:05] falls asleep\r\n[1518-11-01 00:25] wakes up\r\n[1518-11-01 00:30] falls asleep\r\n[1518-11-01 00:55] wakes up\r\n[1518-11-01 23:58] Guard #99 begins shift\r\n[1518-11-02 00:40] falls asleep\r\n[1518-11-02 00:50] wakes up\r\n[1518-11-03 00:05] Guard #10 begins shift\r\n[1518-11-03 00:24] falls asleep\r\n[1518-11-03 00:29] wakes up\r\n[1518-11-04 00:02] Guard #99 begins shift\r\n[1518-11-04 00:36] falls asleep\r\n[1518-11-04 00:46] wakes up\r\n[1518-11-05 00:03] Guard #99 begins shift\r\n[1518-11-05 00:45] falls asleep\r\n[1518-11-05 00:55] wakes up";
            var output = GuardCalculator.GetSleepiestGuard(input);

            output.Should().Be(240);
        }