コード例 #1
0
        public override object SolvePartOne()
        {
            var rlist = new RoomList();

            var lines = FileLineParser.GetAllLines(@"Day04\Day04Input.txt");

            foreach (var line in lines)
            {
                rlist.AddRoom(line);
            }

            return(rlist.SumValidIds());
        }
コード例 #2
0
        public override object SolvePartTwo()
        {
            var rlist = new RoomList();

            var lines = FileLineParser.GetAllLines(@"Day04\Day04Input.txt");

            foreach (var line in lines)
            {
                rlist.AddRoom(line);
            }

            var northpoleobjectstorage = rlist.SearchRoomByName("northpole");

            return($"{northpoleobjectstorage.ID} ({northpoleobjectstorage.DecipherName()})");
        }