Skip to content

Commit

Permalink
string.len() -> #
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Sep 10, 2024
1 parent 7121147 commit 0a67a97
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lua/src/p0008.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ return {
.. "71636269561882670428252483600823257530420752963450")
local answer = 0

for i = 1,(string.len(str)-13),1
for i = 1,(#str-13),1
do
local product = 1
for j = i,(i+12),1
Expand Down
2 changes: 1 addition & 1 deletion lua/src/p0034.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ return {
do
local xs = tostring(x)
local sum = 0
for i = 1,string.len(xs),1
for i = 1,#xs,1
do
sum = sum + factorial(tonumber(xs:sub(i, i)))
end
Expand Down

0 comments on commit 0a67a97

Please sign in to comment.