def part1(instructions):
    """ Find accumulator before bootloop """

    index = 0
    accumulator = 0
    visited = set()

    while index not in visited and index < len(instructions):
        visited.add(index)
        opr, val = instructions[index].split()

        index = index + int(val) if opr == "jmp" else index + 1

        if opr == "acc":
            accumulator += int(val)

    return accumulator