Something went wrong. Try again.
Code for the Advent of Code event
aoc advent-of-code
Something went wrong. Try again.
338 B · 14 lines
Lua
at main
123456789101112131415local nice_count = 0
local input = io.open("input.txt", "r")
for line in input:lines("l") do local repeat_group = line:match("(..).*%1") local repeat_between = line:match("(.).%1")
if repeat_group and repeat_between then nice_count = nice_count + 1 endend
print(("%d strings are nice"):format(nice_count))
input:close()