Skip to content

Commit 7aff651

Browse files
committed
day 22 cleanup
1 parent 4189711 commit 7aff651

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

2021/Day22/Solution.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ namespace AdventOfCode.Y2021.Day22;
88
[ProblemName("Reactor Reboot")]
99
class Solution : Solver {
1010

11-
public object PartOne(string input) => NumberOfActiveCubesInRange(input, 50);
12-
public object PartTwo(string input) => NumberOfActiveCubesInRange(input, int.MaxValue);
11+
public object PartOne(string input) => ActiveCubesInRange(input, 50);
12+
public object PartTwo(string input) => ActiveCubesInRange(input, int.MaxValue);
1313

14-
public long NumberOfActiveCubesInRange(string input, int size) {
14+
public long ActiveCubesInRange(string input, int range) {
1515
var cmds = Parse(input);
1616

1717
// Recursive approach
@@ -36,9 +36,9 @@ long activeCubesAfterIcmd(int icmd, Region region) {
3636
return activeCubesAfterIcmd(
3737
cmds.Length - 1,
3838
new Region(
39-
new Segment(-size, size),
40-
new Segment(-size, size),
41-
new Segment(-size, size)));
39+
new Segment(-range, range),
40+
new Segment(-range, range),
41+
new Segment(-range, range)));
4242
}
4343

4444
Cmd[] Parse(string input) {

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