Ejemplo n.º 1
0
        public void Example6()
        {
            List <string> IdStrings = new List <string> {
                "67", "7", "x", "59", "61"
            };

            BusLines buslines = new BusLines();
            long     result   = buslines.FindSequence2(IdStrings);

            Assert.AreEqual(1261476, result);
        }
Ejemplo n.º 2
0
        public void Example3()
        {
            List <string> IdStrings = new List <string> {
                "17", "x", "13", "19"
            };

            BusLines buslines = new BusLines();
            long     result   = buslines.FindSequence2(IdStrings);

            Assert.AreEqual(3417, result);
        }
Ejemplo n.º 3
0
        public void Example7()
        {
            List <string> IdStrings = new List <string> {
                "1789", "37", "47", "1889"
            };

            BusLines buslines = new BusLines();
            long     result   = buslines.FindSequence2(IdStrings);

            Assert.AreEqual(1202161486, result);
        }
Ejemplo n.º 4
0
        public void Example8()
        {
            List <string> IdStrings = new List <string> {
                "7", "13", "x", "x", "59", "x", "31", "19"
            };

            BusLines buslines = new BusLines();
            long     result   = buslines.FindSequence2(IdStrings);

            Assert.AreEqual(1068781, result);
        }
Ejemplo n.º 5
0
        public static long Problem2()
        {
            List <string> input = File.ReadAllLines("Data/Day13.txt").ToList();
            List <string> ids   = input[1].Split(",").ToList();

            BusLines busslines = new BusLines();

            long result = busslines.FindSequence2(ids);

            Console.WriteLine(result);
            return(result);
        }