long number possibilities code
Answers
Answered by
0
Answer:
long number possibilities code
Answered by
0
Answer:
def sol(a):
x=a.copy()
n = len(a)
a[n-1] += 1
carry = a[n-1]//10
a[n-1] = a[n-1] % 10
i=n-2
while i>=0:
if (carry == 1):
a[i] += 1
carry = a[i]//10
a[i] = a[i] % 10
i-=1
if (carry == 1):
return 0
for i in range(n):
if a[i]!=x[i]:
return i+1
Explanation:
Similar questions