def single_number(integers):
    """
    Naive version: Given a non-empty array of integers, every element appears
    twice except for one. Find that single one.
    Runtime: O(n), Space: O(n)
    """
    seen = set()
    for integer in integers:
        if integer in seen:
            seen.remove(integer)
        else:
            seen.add(integer)

    return seen.pop()