1409A - Yet Another Two Integers Problem
t = int(input())
while t > 0:
a,b = map(int,input().split())
print((abs(a - b) + 9) // 10)
t -= 1
1409A - Yet Another Two Integers Problem
t = int(input())
while t > 0:
a,b = map(int,input().split())
print((abs(a - b) + 9) // 10)
t -= 1
Python Solution
t = int(input())
while t > 0:
n = int(input())
s = input()
if s[n-1] == '0':
s.replace(s[n-1],'')
odd,even = False, False
i = 1
for i in range(n+1):
if i % 2 == 1:
odd |= (int(s[i - 1]) % 2 == 1)
else:
even |= (int(s[i - 1]) % 2 == 0)
if n % 2 == 1:
if (odd):
print(1)
else:
print(2)
else:
if (even):
print(2)
else:
print(1)
t -= 1