예제 #1
0
        public long ExecutePart2(SeatMap seatMap)
        {
            char[][] previousMap = null;
            var      moves       = 0;

            do
            {
                previousMap = seatMap.Map;
                seatMap.ApplyRules2();
                moves++;
            }while (!SeatMap.AreEqual(previousMap, seatMap.Map));

            return(seatMap.Map.Select(file => file.Count(c => c == '#')).Sum());
        }
예제 #2
0
 public Day11()
 {
     _input = File
              .ReadAllText(Path.Combine("Inputs", "input11.txt"))
              .ParseSeatMap();
 }