def get_factors(num: int) -> set[int]:
    """ 
    Gets the factors for a given house number.
    Here, this determines the elves that visit each house.

    Args:
        num (int): the house number we want to get factors for

    Returns:
        set[int]: The set of factors (which represent elf numbers)
    """
    factors = set()

    # E.g. factors of 8 = 1, 2, 4, 8
    # Iterate from 1 to sqrt of 8, where %=0, i.e. 1 and 2
    # E.g. for i=1, we add factors 1 and 8
    #      for i=2, we add factors 2 and 4
    # Use a set to eliminate duplicates, e.g. if i is 4, we only want one 2
    for i in range(1, (int(num**0.5) + 1)):
        if num%i == 0:
            factors.add(i)
            factors.add(num//i)
    
    return factors