@@ -285,42 +285,42 @@ <h2 id="problem-name">Aunt Sue</h2>
285285
286286namespace AdventOfCode.Y2015.Day16;
287287
288- [ProblemName(" Aunt Sue" )]
288+ [ProblemName(" Aunt Sue" )]
289289class Solution : Solver {
290290
291- private Dictionary< string , int > target = new Dictionary< string , int > {
292- [" children" ] = 3,
293- [" cats" ] = 7,
294- [" samoyeds" ] = 2,
295- [" pomeranians" ] = 3,
296- [" akitas" ] = 0,
297- [" vizslas" ] = 0,
298- [" goldfish" ] = 5,
299- [" trees" ] = 3,
300- [" cars" ] = 2,
301- [" perfumes" ] = 1,
291+ private Dictionary< string, int> target = new Dictionary< string, int> {
292+ [" children" ] = 3,
293+ [" cats" ] = 7,
294+ [" samoyeds" ] = 2,
295+ [" pomeranians" ] = 3,
296+ [" akitas" ] = 0,
297+ [" vizslas" ] = 0,
298+ [" goldfish" ] = 5,
299+ [" trees" ] = 3,
300+ [" cars" ] = 2,
301+ [" perfumes" ] = 1,
302302 };
303303
304- public object PartOne(string input) =>
305- Parse(input).FindIndex(p => p.Keys.All(k => p[k] == target[k])) + 1;
304+ public object PartOne(string input) =>
305+ Parse(input).FindIndex(p => p.Keys.All(k => p[k] == target[k])) + 1;
306306
307- public object PartTwo(string input) =>
308- Parse(input).FindIndex(p => p.Keys.All(k => {
309- if (k == " cats" || k == " trees" ) {
310- return p[k] > target[k];
311- } else if (k == " pomeranians" || k == " goldfish" ) {
312- return p[k] < target [k];
307+ public object PartTwo(string input) =>
308+ Parse(input).FindIndex(p => p.Keys.All(k => {
309+ if (k == " cats" || k == " trees" ) {
310+ return p[k] > target[k];
311+ } else if (k == " pomeranians" || k == " goldfish" ) {
312+ return p[k] < target[k];
313313 } else {
314314 return p[k] == target[k];
315315 }
316316 })) + 1;
317317
318- List < Dictionary < string , int > > Parse(string input) => (
319- from line in input.Split('\n' )
320- let parts = Regex.Matches(line, @" (\w+): (\d+)" )
318+ List< Dictionary< string, int>> Parse(string input) => (
319+ from line in input.Split('\n' )
320+ let parts = Regex.Matches(line, @" (\w+): (\d+)" )
321321 select parts.ToDictionary(
322- part => part.Groups[1].Value,
323- part => int.Parse(part.Groups[2].Value))
322+ part => part.Groups[1].Value,
323+ part => int.Parse(part.Groups[2].Value))
324324 ).ToList();
325325}
326326</ code > </ pre > </ div >
0 commit comments