def solution(n,a,b): answer = 1 while True: if abs(a-b)==1 and min(a,b)%2==1: break else: a,b=(a+1)//2, (b+1)//2 answer+=1 return answer
def solution(n,a,b): answer = 0 while a != b: answer += 1 a, b = (a+1)//2, (b+1)//2 return answer