Refactor Day04 min instruction length naming for readability
This commit is contained in:
1 parent
7e120081c1
commit
3781e28851
1 file changed
+3
-3
+3
-3
@@ -29,11 +29,11 @@ public class Day04 : IPuzzleSolver<long>
|
||||
|
||||
private static int GetMinInstructionLength(string barcode)
|
||||
{
|
||||
for (var i = 1; i <= barcode.Length; i++)
|
||||
for (var patternLength = 1; patternLength <= barcode.Length; patternLength++)
|
||||
{
|
||||
var pattern = barcode[0..i];
|
||||
var pattern = barcode[0..patternLength];
|
||||
if(CreatesBarcode([..pattern], barcode))
|
||||
return pattern.Length;
|
||||
return patternLength;
|
||||
}
|
||||
return barcode.Length;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user