private int Part1CountCalculator(ImageLayer[] layers) { ImageLayer layer = null; int minZeroes = int.MaxValue; foreach (var l in layers) { if (l.GetPixelCount(0) < minZeroes) { layer = l; minZeroes = l.GetPixelCount(0); } } return(layer.GetPixelCount(1) * layer.GetPixelCount(2)); }