forked from Bananymous/banan-os
AOC2023: remove unnecessary loop
This commit is contained in:
parent
41f8974080
commit
cf76d2e7d9
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue