Solutions for multiplication table

    • @TerryDic
    • @Robert, submitted in Python 2, achived 100% score
    import random,json
    def solve(n, x):
        if n == 1:
            return n
    
        tuples = list()
        for i in range(1, (x + 1) // 2):
            if not x % i:
                tuples.append((i, x // i))
    
        return len(tuples)
    • @TerryDic
    • @Robert, submitted in Python 3, achived 100% score
    import random,json
    def solve(n, x):
        if n == 1:
            return n
    
        tuples = list()
        for i in range(1, (x + 1) // 2):
            if not x % i:
                tuples.append((i, x // i))
    
        return len(tuples)