using DataStructures

part1, part2 = 0, 0
for line in readlines("input.txt")
    range, char, password = split(line)

    l, u = parse.(Int, split(range, "-"))
    c = first(char)

    cntr = counter(collect(password))

    part1 += l ≤ cntr[c] ≤ u
    part2 += (password[l] == c) ⊻ (password[u] == c)
end

@info "Solutions:" part1 part2
