Beispiel #1
0
        public static void FindAsleepGuard()
        {
            List <Guard> guards = ReposeRecord.Build();
            Guard        frequentSleeperGuard = ReposeRecord.FrequentSleeper(guards, out int maxSleptMinute);

            int guardMinute = frequentSleeperGuard.Id.AsInt() * maxSleptMinute;

            Console.WriteLine($"Guard #{frequentSleeperGuard.Id} slept the most frequently on minute {maxSleptMinute}. Key is: {guardMinute}");
        }
Beispiel #2
0
        public static void FindAsleepGuard()
        {
            List <Guard> guards = ReposeRecord.Build();

            Guard maxSleptGuard  = ReposeRecord.LongestSleeper(guards);
            int   maxSleptMinute = ReposeRecord.MostSleptMinute(maxSleptGuard);

            int guardMinute = maxSleptGuard.Id.AsInt() * maxSleptMinute;

            Console.WriteLine($"Guard #{maxSleptGuard.Id} slept the most on minute {maxSleptMinute}. Key is: {guardMinute}");
        }