Question: 
Write a python function to find the sum of common divisors of two given numbers.


Model's Code:
def sum(a, b):
    def gcd(x, y):
        while y:
            x, y = y, x % y
        return x
    
    common_divisors_sum = 0
    g = gcd(a, b)
    
    for i in range(1, g + 1):
        if g % i == 0:
            common_divisors_sum += i
            
    return common_divisors_sum



Sample Correct Code:
def sum(a,b): 
    sum = 0
    for i in range (1,min(a,b)): 
        if (a % i == 0 and b % i == 0): 
            sum += i 
    return sum


Asserts:
assert sum(10,15) == 6
assert sum(100,150) == 93
assert sum(4,6) == 3


Tests:
Test 1 of 3: PASS
Test 2 of 3: PASS
Test 3 of 3: PASS

Test 126 of 974: 93/126 (73.80952380952381%): success