Day 03 part 2
var
answer: Natural
elfGroup: seq[string]
proc countPri(c: char): Natural =
if c.ord >= 'a'.ord and c.ord <= 'z'.ord: result.inc c.ord - 'a'.ord + 1
elif c.ord >= 'A'.ord and c.ord <= 'Z'.ord: result.inc c.ord - 38
proc score(): Natural =
var chars = toHashSet(elfGroup.pop)
while elfGroup.len > 0: chars = chars * toHashSet(elfGroup.pop)
result = countPri(chars.pop())
for l in "input.txt".lines:
elfGroup.add(l)
if elfGroup.len == 3: answer.inc score()
Answer is: 2697