From 49444b7f951168d2066bc41efed0a9ff04731a03 Mon Sep 17 00:00:00 2001 From: Olivia Appleton Date: Mon, 9 Sep 2024 00:26:10 -0500 Subject: [PATCH] fix some logic errors --- lua/src/p0034.lua | 2 +- lua/src/p0076.lua | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/src/p0034.lua b/lua/src/p0034.lua index f444dd9c..a6c53812 100644 --- a/lua/src/p0034.lua +++ b/lua/src/p0034.lua @@ -30,7 +30,7 @@ return { if sum == x then - answer = answer + 1 + answer = answer + x end end diff --git a/lua/src/p0076.lua b/lua/src/p0076.lua index 1c0f8724..6d376c4e 100644 --- a/lua/src/p0076.lua +++ b/lua/src/p0076.lua @@ -41,6 +41,7 @@ return { idx = idx + 1 counts[idx] = counts[idx] + idx + sum = 0 for i = idx,100,1 do sum = sum + counts[i]