Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import math
from functools import reduce

def main():
    na = list(map(int, input().split()))
    N, X = na[0], na[1]
    x = list(map(int, input().split()))

    y = list(map(lambda v: abs(v - X), x))

    a = reduce(math.gcd, y)

    print(a)


if __name__ == '__main__':
    main()



Fixed submission:
#!/usr/bin/env python3
from functools import reduce

def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while 0 < b:
        a, b = b, a % b
    return a


def main():
    na = list(map(int, input().split()))
    N, X = na[0], na[1]
    x = list(map(int, input().split()))

    y = list(map(lambda v: abs(v - X), x))

    a = reduce(gcd, y)

    print(a)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import math
#from functools import reduce

def main():
    na = list(map(int, input().split()))
    N, X = na[0], na[1]
    x = list(map(int, input().split()))

    lmd = lambda v: abs(v - X)
    y = list(map(lmd, x))

#    g = reduce(math.gcd, y)

    a = y.pop(0)
    while 0 < len(y):
        b = y.pop(0)
        a = math.gcd(a, b)

    print(a)


if __name__ == '__main__':
    main()



Fixed submission:
#!/usr/bin/env python3
from functools import reduce

def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while 0 < b:
        a, b = b, a % b
    return a


def main():
    na = list(map(int, input().split()))
    N, X = na[0], na[1]
    x = list(map(int, input().split()))

    y = list(map(lambda v: abs(v - X), x))

    a = reduce(gcd, y)

    print(a)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import math
#from functools import reduce

def main():
    na = list(map(int, input().split()))
    N, X = na[0], na[1]
    x = list(map(int, input().split()))

    y = list(map(lambda v: v - X, x))

#    g = reduce(math.gcd, y)

    a = y.pop(0)
    while 0 < len(y):
        b = y.pop(0)
        a = math.gcd(a, b)

    print(a)


if __name__ == '__main__':
    main()



Fixed submission:
#!/usr/bin/env python3
from functools import reduce

def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while 0 < b:
        a, b = b, a % b
    return a


def main():
    na = list(map(int, input().split()))
    N, X = na[0], na[1]
    x = list(map(int, input().split()))

    y = list(map(lambda v: abs(v - X), x))

    a = reduce(gcd, y)

    print(a)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import math
from functools import reduce

def main():
    na = list(map(int, input().split()))
    N, X = na[0], na[1]
    x = list(map(int, input().split()))

    y = list(map(lambda v: v - X, x))

    g = reduce(math.gcd, y)

    print(g)


if __name__ == '__main__':
    main()



Fixed submission:
#!/usr/bin/env python3
from functools import reduce

def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while 0 < b:
        a, b = b, a % b
    return a


def main():
    na = list(map(int, input().split()))
    N, X = na[0], na[1]
    x = list(map(int, input().split()))

    y = list(map(lambda v: abs(v - X), x))

    a = reduce(gcd, y)

    print(a)


if __name__ == '__main__':
    main()