this is my approach for cryptopangrams problem solved in Python3:-

def gcd(x, y):

    while y:
        x, y = y, x % y

    return x


alpha = []
count = 1
t = int(input())
while t > 0:
    ans = ""
    inp = input()
    inp2 = input()
    a, b = inp.split()
    c = list(map(int, inp2.split()))
    alpha.append(int(c[0] / gcd(c[0], c[1])))
    for i in range(len(c)):
        alpha.append(int(c[i] / alpha[i]))
    oalpha = alpha.copy()
    alpha.sort()
    l = len(alpha) - 1
    while l > 0:
        if alpha[l] == alpha[l - 1]:
            alpha.pop(l)
        l = l - 1
    for i in oalpha:
        ans = ans + chr(ord("A") + alpha.index(i))
    print("Case #" + str(count) + ": " + ans)
    t = t - 1
    count = count + 1
    alpha.clear()
    oalpha.clear()


Can someone please explain why i m getting runtime error on CodeJam. When i 
run it locally using the sample input i dont get a RE.
As far as i have checked my code does not have a division by 0 in any 
corner conditions.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/86be5568-fcaa-4dc2-aa9e-4d33b9ca6410%40googlegroups.com.

Reply via email to