Skip to content

Commit 88fe6a0

Browse files
committed
day 24 cleanup
1 parent 947a5d9 commit 88fe6a0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

2021/Day24/Solution.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ class Solution : Solver {
1414

1515
var digits = Enumerable.Range(1, 9).ToArray();
1616

17-
var stmBlocks = input.Split("inp w\n")[1..]; // The input has 14 code blocks, each dealing with one digit.
17+
// The input has 14 code blocks, each dealing with one digit.
18+
// The blocks define 7 pairs of `a`, `b` digits and a `shift` between them.
19+
// The input is valid if for each pair the condition `a + shift = b` holds.
20+
var stmBlocks = input.Split("inp w\n")[1..];
1821

1922
// Extracts the numeric argument of a statement:
2023
var getArgFromLine = (int iblock, Index iline) =>
2124
int.Parse(stmBlocks[iblock].Split('\n')[iline].Split(' ')[^1]);
2225

23-
// The blocks define 7 pairs of `a`, `b` digits and a `shift` between them.
24-
// The input is valid if for each pair the condition `a + shift = b` holds.
25-
2626
// A stack will contain the index of an `a` digit when we find it's corresponding `b`.
2727
var stack = new Stack<int>();
2828

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy