AOC2023: remove unnecessary loop

This commit is contained in:
Bananymous 2023-12-04 17:54:10 +02:00
parent 41f8974080
commit cf76d2e7d9
1 changed files with 2 additions and 4 deletions

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;