about summary refs log tree commit diff
path: root/codechef/binadd.py
blob: 3ab0bab33391fdf16c5f973c04c3dcbe98822d25 (plain) (blame)
1
2
3
4
5
6
7
8
9
#!/usr/bin/env python3
for t in range(int(input())):
    e, p = input(), input()
    a, b = int(e, 2), int(p, 2)
    count = 0
    while b:
        a, b = a^b, (a&b)<<1
        count += 1
    print(count)