AOC2023: remove unnecessary loop

This commit is contained in:
2023-12-04 17:54:10 +02:00
parent 41f8974080
commit cf76d2e7d9

View File

@@ -32,10 +32,8 @@ int puzzle1(FILE* fp)
continue;
int matching = matching_numbers(buffer);
int points = !!matching;
for (int i = 1; i < matching; i++)
points *= 2;
result += points;
if (matching > 0)
result += 1 << (matching - 1);
}
return result;