My issue
what is error in my code. it fails at a hidden testcase
My code
# cook your dish here
def marblebig(x,y):
c = 0
while x%y!=0:
x+=1
y-=1
c+=1
return c
def marblesmall(x,y):
c = 0
while y%x!=0:
x-=1
y+=1
c+=1
return c
def marble(x,y):
if x%y==0 or y%x == 0:
return 0
if x>y:
a = marblesmall(x,y)
b = marblebig(x,y)
return min([a,b])
return marblebig(x,y)
t=int(input())
for _ in range(t):
a,b=map(int,input().split())
print(marble(a,b))
Problem Link: Marbles Practice Coding Problem