예제 #1
0
        /// <summary>
        /// https://adventofcode.com/2020/day/13#part2
        /// </summary>
        public static void Part2()
        {
            var notes = BusNotes.Parse(Input.Get(13));
            var t     = Contest(notes.BusIds.ToArray());

            Console.WriteLine(t);
        }
예제 #2
0
        /// <summary>
        /// https://adventofcode.com/2020/day/13
        /// </summary>
        public static void Part1()
        {
            var notes    = BusNotes.Parse(Input.Get(13));
            var earliest = notes.GetNextBus();
            var waitTime = notes.GetWaitTime(earliest);

            Console.WriteLine(earliest * waitTime);
        }