Find all numbers that are factors of one array and factor into the second array, then print their count I'm working on a solution to the Following problem on Hackerrank, and I seem to have found a function that works for the purpose.
However, I feel as though this is a very overdesigned solution to a problem that appears, at first glance, to be simple. This is what I've come up with so far:
This code takes in two arrays, finds every pair of numbers from 1 to 100, multiplies them together, and tests if the product is a factor of all elements in the first array. If so, it appends the product to the fact array. Then, it tests every element in the fact array and checks if the element evenly divides every element in the second array. If so, it loads that element into a new list. Finally, it returns the length of the new list
I've run the code through a few static analyzers but they became unhelpful after a point. I'm looking for ways to cut this code down and reduce its complexity and depth. Any comments or criticisms are welcome!
Apologies if I've made any mistakes in my question-asking etiquette here, feel free to let me know if this needs more context and thanks in advance!
def get_total_x(input_factors: int, test_numbers: int) -&gt; int:
    fact = list()
    output = list()
    for mult1 in range(100):
        for mult2 in range(100):
            # find all multiples of mult1 and mult2 that can be factored
            # into all numbers in a, while ignoring zero.
            if all(v == 0 for v in [(mult1 * mult2) % factor for factor in input_factors]) and (mult1 * mult2 != 0):
                fact.append(mult1 * mult2)
    seen = set()
    seen_add = seen.add
    # remove duplicates, may be able to cut out?
    fact = [x for x in fact if not (x in seen or seen_add(x))]
    for test in fact:
        # check for all numbers from the previous loop that divide b cleanly.
        if all(w == 0 for w in [factor2 % test for factor2 in test_numbers]):
            output.append(test)

    return len(output)


if __name__ == '__main__':

    arr = (2, 4)

    brr = (16, 32, 96)

    total = get_total_x(arr, brr)

    print(total)
Redundant calculations
You calculate mult1 * mult2 three times. Instead, do this once, assign it to a variable, and use that.

Since you want to never want to calculate when a value is 0, you can set the start of range to 1.
range(1, 101) # 1 -&gt; 100, since (inclusive, exclusive)

Now you can remove that (product != 0) check.
Type hints
At first, it looks like the function accepts two integers. In reality, it accepts two tuples of integers. Consider doing the following:
from typing import Tuple

def get_total_x(input_factors: Tuple[int], test_numbers: Tuple[int]) -&gt; int:

This makes it clear that you want tuples of integers as parameters, instead of a single integer.
Using sets
You use a set, but you don't actually use the set. You're trying to add values to the set that aren't already there, or that you can add to the set. Instead of having that list comprehension, simply cast fact into a set. Does the exact same thing.
fact = set(fact)

Magic numbers
What is the significance of 100? I see in your question you explain, but not in the code. I would assign this to a variable to make it more clear.