A solution for Advent of Code 2018 Day 1