From b3f90f7976adc2adf4e967b8e8ed9f856a1c5c30 Mon Sep 17 00:00:00 2001 From: "Valeriano A.R" Date: Tue, 4 Dec 2018 09:13:26 +0100 Subject: [PATCH] Day03: Add part 2 statement and remove unnecessary initialization --- AdventOfCode2018/Day03.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/AdventOfCode2018/Day03.cs b/AdventOfCode2018/Day03.cs index 1a29527..533c516 100644 --- a/AdventOfCode2018/Day03.cs +++ b/AdventOfCode2018/Day03.cs @@ -51,6 +51,14 @@ namespace AdventOfCode2018 If the Elves all proceed with their own plans, none of them will have enough fabric. How many square inches of fabric are within two or more claims? + --- Part Two --- + + Amidst the chaos, you notice that exactly one claim doesn't overlap by even a single square inch of fabric with any other claim. If you can somehow draw attention to it, maybe the Elves will be able to make Santa's suit after all! + + For example, in the claims above, only claim 3 is intact after all claims are made. + + What is the ID of the only claim that doesn't overlap? + */ public class Day03 @@ -62,14 +70,6 @@ namespace AdventOfCode2018 const int edgeSize = 1000; int[,] cells = new int[edgeSize, edgeSize]; - for (int j = 0; j < edgeSize; j++) - { - for (int i = 0; i < edgeSize; i++) - { - cells[i, j] = 0; - } - } - foreach (Claim claim in claims) { for (int j = 0; j < claim.Height; j++)