From cc2d26fa69635c02b15e13f1fc59d6fb93573a02 Mon Sep 17 00:00:00 2001 From: Olivia Appleton Date: Mon, 9 Sep 2024 00:01:31 -0500 Subject: [PATCH] typos --- lua/src/p0034.lua | 4 ++-- lua/src/p0076.lua | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lua/src/p0034.lua b/lua/src/p0034.lua index 02776fad..f36d4f2e 100644 --- a/lua/src/p0034.lua +++ b/lua/src/p0034.lua @@ -13,6 +13,8 @@ -- -- Note: as 1! = 1 and 2! = 2 are not sums they are not included. +local factorial = loadfile('src/lib/math.lua')().factorial + return { solution = function() local answer = 0 @@ -36,5 +38,3 @@ return { return answer end } - -local factorial = loadfile('src/lib/math.lua')().factorial diff --git a/lua/src/p0076.lua b/lua/src/p0076.lua index c9fa6390..e5054788 100644 --- a/lua/src/p0076.lua +++ b/lua/src/p0076.lua @@ -13,12 +13,10 @@ -- -- Note: as 1! = 1 and 2! = 2 are not sums they are not included. -local factorial = loadfile('src/lib/math.lua')().factorial - return { solution = function() local answer = 0 - local idx = 0 + local idx local sum = 100 local counts = {} @@ -36,7 +34,7 @@ return { then answer = answer + (100 + counts[2 + 1] - sum) / 2 idx = 2 - + repeat idx = idx + 1 counts[idx] = 0 -- please remember lua is 1-indexed