diff --git a/day3/day3.lua b/day3/day3.lua index 779ec5b..e7cd512 100644 --- a/day3/day3.lua +++ b/day3/day3.lua @@ -7,7 +7,7 @@ function find_duplicates(first, second) for i = 1, #first do local char = string.sub(first, i, i) - if string.match(second, char) then + if string.find(second, char) then if char == string.upper(char) then return string.byte(char) - string.byte("A") + 27 elseif char == string.lower(char) then diff --git a/day3/day3part2.lua b/day3/day3part2.lua index af7c405..a3c6601 100644 --- a/day3/day3part2.lua +++ b/day3/day3part2.lua @@ -11,7 +11,7 @@ end function find_duplicates(one, two, three) for i = 1, #one do local char = string.sub(one, i, i) - if string.match(two, char) and string.match(three, char) then + if string.find(two, char) and string.find(three, char) then if char == string.upper(char) then return string.byte(char) - string.byte("A") + 27 elseif char == string.lower(char) then