Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
lst = list(map(int, input().split()))
 
lst.append(x)
lst.sort()
 
dif_lst = []
for i in range(len(lst)-1):
    dif = lst[i+1] - lst[i]
    dif_lst.append(lst[i+1] - lst[i])
dif_lst.sort()
 
def dif_get(lst):
    dif_lst = [lst[0]]
    for i in range(len(lst)-1):
        dif = lst[i+1] - lst[i]
        if dif == 0:
            continue
        else:
            dif_lst.append(lst[i+1] - lst[i])
    dif_lst.sort()
    if dif_lst[0] == 1:
        return 1
    elif len(dif_lst) == 1:
        return dif_lst[0]
    else:
        return dif_get(dif_lst)
 
print(dif_get(dif_lst))

Fixed submission:
n,x = map(int,input().split())
lst = list(map(int, input().split()))
 
lst.append(x)
lst.sort()
 
dif_lst = []
for i in range(len(lst)-1):
    dif = lst[i+1] - lst[i]
    dif_lst.append(lst[i+1] - lst[i])
dif_lst.sort()

lst = dif_lst
while True:
    dif_lst = [lst[0]]
    for i in range(len(lst)-1):
        dif = lst[i+1] - lst[i]
        if dif == 0:
            continue
        else:
            dif_lst.append(lst[i+1] - lst[i])
    dif_lst.sort()
    if dif_lst[0] == 1:
        print(1)
        break
    elif len(dif_lst) == 1:
        print(dif_lst[0])
        break
    lst = dif_lst

Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
lst = list(map(int, input().split()))
 
lst.append(x)
lst.sort()
 
dif_lst = []
for i in range(len(lst)-1):
    dif = lst[i+1] - lst[i]
    if dif == 0:
        continue
    else:
        dif_lst.append(lst[i+1] - lst[i])
dif_lst.sort()
 
def dif_get(lst):
    dif_lst = [lst[0]]
    for i in range(len(lst)-1):
        dif = lst[i+1] - lst[i]
        if dif == 0:
            continue
        else:
            dif_lst.append(lst[i+1] - lst[i])
    dif_lst.sort()
    if dif_lst[0] == 1:
        return 1
    if len(dif_lst) == 1:
        return dif_lst[0]
    else:
        return dif_get(dif_lst)
 
print(dif_get(dif_lst))

Fixed submission:
n,x = map(int,input().split())
lst = list(map(int, input().split()))
 
lst.append(x)
lst.sort()
 
dif_lst = []
for i in range(len(lst)-1):
    dif = lst[i+1] - lst[i]
    dif_lst.append(lst[i+1] - lst[i])
dif_lst.sort()

lst = dif_lst
while True:
    dif_lst = [lst[0]]
    for i in range(len(lst)-1):
        dif = lst[i+1] - lst[i]
        if dif == 0:
            continue
        else:
            dif_lst.append(lst[i+1] - lst[i])
    dif_lst.sort()
    if dif_lst[0] == 1:
        print(1)
        break
    elif len(dif_lst) == 1:
        print(dif_lst[0])
        break
    lst = dif_lst

Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
lst = list(map(int, input().split()))

lst.append(x)
lst.sort()

dif_lst = []
for i in range(len(lst)-1):
    dif_lst.append(lst[i+1] - lst[i])
dif_lst.sort()

def dif_get(lst):
    dif_lst = [lst[0]]
    for i in range(len(lst)-1):
        dif = lst[i+1] - lst[i]
        if dif == 0:
            continue
        else:
            dif_lst.append(lst[i+1] - lst[i])
    dif_lst.sort()
    if dif_lst[0] == 1:
        return 1
    if len(dif_lst) == 1:
        return dif_lst[0]
    else:
        return dif_get(dif_lst)

print(dif_get(dif_lst))

Fixed submission:
n,x = map(int,input().split())
lst = list(map(int, input().split()))
 
lst.append(x)
lst.sort()
 
dif_lst = []
for i in range(len(lst)-1):
    dif = lst[i+1] - lst[i]
    dif_lst.append(lst[i+1] - lst[i])
dif_lst.sort()

lst = dif_lst
while True:
    dif_lst = [lst[0]]
    for i in range(len(lst)-1):
        dif = lst[i+1] - lst[i]
        if dif == 0:
            continue
        else:
            dif_lst.append(lst[i+1] - lst[i])
    dif_lst.sort()
    if dif_lst[0] == 1:
        print(1)
        break
    elif len(dif_lst) == 1:
        print(dif_lst[0])
        break
    lst = dif_lst