Ejemplo n.º 1
0
        public void Part2()
        {
            var busSchedule = new BusSchedule(_input[1]);
            var answer      = busSchedule.GetAnswerForContestWithSpeed();

            TestContext.WriteLine($"Answer = {answer}");
        }
Ejemplo n.º 2
0
        public void Part1()
        {
            var busSchedule   = new BusSchedule(_input[1]);
            var timestamp     = int.Parse(_input[0]);
            var nextDeparture = busSchedule.GetNextDeparture(timestamp);
            var answer        = (nextDeparture.Timestamp - timestamp) * nextDeparture.Bus;

            TestContext.WriteLine($"Answer = {answer}");
        }
Ejemplo n.º 3
0
        public void Part1WithTestData()
        {
            var busSchedule   = new BusSchedule(_testData[1]);
            var timestamp     = int.Parse(_testData[0]);
            var nextDeparture = busSchedule.GetNextDeparture(timestamp);
            var answer        = (nextDeparture.Timestamp - timestamp) * nextDeparture.Bus;

            answer.ShouldBe(295);
        }
Ejemplo n.º 4
0
        public long Part2WithSpeedTestData(string input)
        {
            var busSchedule = new BusSchedule(input);

            return(busSchedule.GetAnswerForContestWithSpeed());
        }