from util.util import base

class solve_day(base):
    def part1(self):
        return len([d for d in zip(self.data, self.data[1:]) if d[1]>d[0]])


    def part2(self):
        groups = [d for d in zip(self.data, self.data[1:], self.data[2:])]
        return len([g for g in zip(groups, groups[1:]) if sum(g[1])>sum(g[0])])


if __name__ == '__main__':
    s = solve_day('numbers')
    s.sub(s.part1(), part='a')
    s.sub(s.part2(), part='b')