Skip to content

Commit

Permalink
Minor optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Sep 10, 2024
1 parent 8f69004 commit 7121147
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lua/src/p0076.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ return {
local sum = 100
local counts = {}

for i = 0,100,1
for i = 2,100,1
do
counts[i] = 0
end
Expand All @@ -41,16 +41,16 @@ return {
idx = idx + 1
counts[idx] = counts[idx] + idx

sum = 0
for i = idx,100,1
sum = counts[idx]
for i = (idx+1),100,1
do
sum = sum + counts[i]
end
until sum <= 100
end

sum = 0
for i = 0,100,1
sum = counts[2]
for i = 3,100,1
do
sum = sum + counts[i]
end
Expand Down

0 comments on commit 7121147

Please sign in to comment.