Ejemplo n.º 1
0
        public void FindSolutionToPart2()
        {
            var fabric      = new byte[1000, 1000];
            var claimLedger = new ClaimLedger();

            claimLedger.LoadClaims("day3/input.txt");

            fabric.Allocate(claimLedger);

            Assert.That(claimLedger.Claims.Count(x => !fabric.IsOverAllocated(x)), Is.EqualTo(1));
            Assert.That(claimLedger.Claims.First(x => !fabric.IsOverAllocated(x)).Id, Is.EqualTo(686));
        }
Ejemplo n.º 2
0
        public int TestAlgorithm(params string[] claims)
        {
            var fabric      = new byte[10, 10];
            var claimLedger = new ClaimLedger();

            claimLedger.Add(claims);
            fabric.Allocate(claimLedger);

            var requested = fabric.CheckOverAllocation();

            return(requested);
        }
Ejemplo n.º 3
0
        public void FindSolutionToPart1()
        {
            var fabric      = new byte[1000, 1000];
            var claimLedger = new ClaimLedger();

            claimLedger.LoadClaims("day3/input.txt");

            fabric.Allocate(claimLedger);

            var overAllocatedArea = fabric.CheckOverAllocation();

            Assert.That(overAllocatedArea, Is.EqualTo(103482));
        }