Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()

if n < 2:
    print(0)
    exit(0)

cum_r = [0] * (n + 1)
cum_g = [0] * (n + 1)
cum_b = [0] * (n + 1)

for i in range(n):
    cum_r[i + 1] = cum_r[i]
    cum_g[i + 1] = cum_g[i]
    cum_b[i + 1] = cum_b[i]
    if s[i] == "R":
        cum_r[i + 1] += 1
    elif s[i] == "G":
        cum_g[i + 1] += 1
    else:  # s[i] == "b":
        cum_b[i + 1] += 1

sum = 0
for i in range(n - 2):
    for k in range(n - 1, i + 1, -1):
        if s[i] == s[k]:
            continue

        # check "b"
        if (s[i] == "R" and s[k] == "G") or (s[i] == "G" and s[k] == "R"):
            sum += cum_b[k] - cum_b[i + 1]
            if (k + i) % 2 == 0 and s[(k + i) // 2] == "B":
                sum -= 1
        elif (s[i] == "R" and s[k] == "B") or (s[i] == "B" and s[k] == "R"):
            sum += cum_g[k] - cum_g[i + 1]
            if (k + i) % 2 == 0 and s[(k + i) // 2] == "G":
                sum -= 1
        else:
            sum += cum_r[k] - cum_r[i + 1]
            if (k + i) % 2 == 0 and s[(k + i) // 2] == "R":
                sum -= 1

print(sum)


Fixed submission:
n = int(input())
s = input()

if n < 2:
    print(0)
    exit(0)

cum_r = [0] * (n + 1)
cum_g = [0] * (n + 1)
cum_b = [0] * (n + 1)

for i in range(n):
    cum_r[i + 1] = cum_r[i]
    cum_g[i + 1] = cum_g[i]
    cum_b[i + 1] = cum_b[i]
    if s[i] == "R":
        cum_r[i + 1] += 1
    elif s[i] == "G":
        cum_g[i + 1] += 1
    else:  # s[i] == "b":
        cum_b[i + 1] += 1

sum = 0
for i in range(n - 2):
    for k in range(n - 1, i + 1, -1):
        if s[i] == s[k]:
            continue

        # check "b"
        if (s[i] == "R" and s[k] == "G") or (s[i] == "G" and s[k] == "R"):
            sum += cum_b[k] - cum_b[i + 1]
            if (k + i) % 2 == 0 and s[(k + i) // 2] == "B":
                sum -= 1
        elif (s[i] == "R" and s[k] == "B") or (s[i] == "B" and s[k] == "R"):
            sum += cum_g[k] - cum_g[i + 1]
            if (k + i) % 2 == 0 and s[(k + i) // 2] == "G":
                sum -= 1
        else:
            sum += cum_r[k] - cum_r[i + 1]
            if (k + i) % 2 == 0 and s[(k + i) // 2] == "R":
                sum -= 1

print(sum)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())

a = list(map(int, input().split()))
a.sort(reverse=True)
total = sum(a)

canPick = True
for i in range(m):
    if a[m] < total // (4 * m):
        canPick = False

if canPick is True:
    print("Yes")
else:
    print("No")


Fixed submission:
n, m = map(int, input().split())

a = list(map(int, input().split()))
a.sort(reverse=True)
total = sum(a)

canPick = True
for i in range(m):
    if a[i] < total / (4 * m):
        canPick = False

if canPick is True:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())

a = list(map(int, input().split()))
a.sort(reverse=True)
total = sum(a)

canPick = True
for i in range(m):
    if a[m] < total / (4 * m):
        canPick = False

if canPick is True:
    print("Yes")
else:
    print("No")


Fixed submission:
n, m = map(int, input().split())

a = list(map(int, input().split()))
a.sort(reverse=True)
total = sum(a)

canPick = True
for i in range(m):
    if a[i] < total / (4 * m):
        canPick = False

if canPick is True:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
s = input()
n = len(s)
top = s[:(n-1)//2]
bottom = s[(n+3)//2-1:]

if s==s[::-1] and top == top[::-1] and bottom = bottom[::-1]:
  print("Yes")
else:
  print("No")

Fixed submission:
s = input()
n = len(s)
top = s[: (n - 1) // 2]
bottom = s[(n + 3) // 2 - 1 :]

if s == s[::-1] and top == top[::-1] and bottom == bottom[::-1]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
h, w, k = map(int, input().split())

choco = [[0] * w for _ in range(h)]

for i in range(h):
    s = input()
    for j in range(w):
        choco[i][j] = int(s[j])

ans = float("inf")
for bit in range(1 << (h - 1)):
    idx = [0] * h
    group = 0
    for i in range(h):
        idx[i] = group
        if (bit >> i) & 1:
            group += 1
    group += 1
    array = [[0] * w for _ in range(group)]
    for j in range(w):
        for i in range(h):
            array[idx[i]][j] += choco[i][j]

    cnt = group - 1
    cum = [0] * group
    canAdd = True
    for i in range(w):
        for j in range(group):
            if cum[j] > k:
                canAdd = False

        if canAdd is False:
            break

        for j in range(group):
            tmp = cum[j] + array[j][i]
            if tmp > k:
                cnt += 1
                for l in range(group):
                    cum[l] = array[l][i]
                break
            cum[j] += array[j][i]

    if canAdd:
        ans = min(ans, cnt)

print(ans)


Fixed submission:
h, w, k = map(int, input().split())

choco = [[0] * w for _ in range(h)]

for i in range(h):
    s = input()
    for j in range(w):
        choco[i][j] = int(s[j])

ans = float("inf")
for bit in range(1 << (h - 1)):
    idx = [0] * h
    group = 0
    for i in range(h):
        idx[i] = group
        if (bit >> i) & 1:
            group += 1
    group += 1
    array = [[0] * w for _ in range(group)]
    for j in range(w):
        for i in range(h):
            array[idx[i]][j] += choco[i][j]

    cnt = group - 1
    cum = [0] * group
    canAdd = True
    for i in range(w):
        for j in range(group):
            if cum[j] > k:
                canAdd = False

        if ans <= cnt:
            canAdd = False

        if canAdd is False:
            break

        for j in range(group):
            tmp = cum[j] + array[j][i]
            if tmp > k:
                cnt += 1
                for l in range(group):
                    cum[l] = array[l][i]
                break
            cum[j] += array[j][i]

    if canAdd:
        ans = min(ans, cnt)

print(ans)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

upper = 1300

price = -1
for i in range(1, upper):
  tax8 = int(i*0.08)
  tax10 = int(i*0.1)
  if a == tax8 ans b == tax10:
    price = i
    break
    
print(price)

Fixed submission:
a, b = map(int, input().split())

upper = 1300

price = -1
for i in range(1, upper):
    tax8 = int(i * 0.08)
    tax10 = int(i * 0.1)
    if a == tax8 and b == tax10:
        price = i
        break

print(price)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
 
conds = []
 
for i in range(m):
    s, c = map(int, input().split())
    conds.append([s, c])
 
# seiri conditions
conds = sorted(conds)
for i in range(len(conds)):
    if i + 1 < len(conds) and (conds[i][0] == conds[i + 1][0]
                               and conds[i][1] != conds[i + 1][1]):
        print(-1)
        exit(0)
 
# list to check conditions.If -1, no condition
fix = [-1] * n
 
for i in range(len(conds)):
    fix[conds[i][0] - 1] = conds[i][1]
 
ans = 0
for i in range(n):
    if fix[i] == -1 and (i == 0 and n != 1):
        fix[i] = 1
    elif fix[i] == -1:
        fix[i] = 0
    else:
      print(-1)
      exit(0)
 
for i in range(n):
    ans = ans * 10 + fix[i]
 
print(ans)
n, m = map(int, input().split())

conds = []

for i in range(m):
    s, c = map(int, input().split())
    conds.append([s, c])

# seiri conditions
conds = sorted(conds)
for i in range(len(conds)):
    if i + 1 < len(conds) and (conds[i][0] == conds[i + 1][0]
                               and conds[i][1] != conds[i + 1][1]):
        print(-1)
        exit(0)

# list to check conditions.If -1, no condition
fix = [-1] * n

for i in range(len(conds)):
    fix[conds[i][0] - 1] = conds[i][1]

ans = 0
isTopNumFixd = False
for i in range(n):
    if fix[i] == -1 and (i == 0 and n != 1):
        fix[i] = 1
        isTopNumFixd = True
    elif fix[i] == -1:
        fix[i] = 0
        isTopNumFixd = True

for i in range(n):
    ans = ans * 10 + fix[i]

print(ans)

Fixed submission:
n, m = map(int, input().split())

conds = []

for i in range(m):
    s, c = map(int, input().split())
    conds.append([s, c])

# seiri conditions
conds = sorted(conds)
for i in range(len(conds)):
    if i + 1 < len(conds) and (conds[i][0] == conds[i + 1][0]
                               and conds[i][1] != conds[i + 1][1]):
        print(-1)
        exit(0)

# list to check conditions.If -1, no condition
fix = [-1] * n

for i in range(len(conds)):
    fix[conds[i][0] - 1] = conds[i][1]

ans = 0
isTopNumFixd = False
for i in range(n):
    if fix[i] == -1 and (i == 0 and n != 1):
        fix[i] = 1
        isTopNumFixd = True
    elif fix[i] == -1:
        fix[i] = 0
        isTopNumFixd = True
    elif fix[i] == 0 and (i == 0 and n != 1):
        print(-1)
        exit(0)

for i in range(n):
    ans = ans * 10 + fix[i]

print(ans)
Buggy python submission (verdict: Runtime Error):
h,a = map(int, input().split())

print(math.ceil(h/a))

Fixed submission:
import math

h, a = map(int, input().split())

print(math.ceil(h / a))
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
pat = "ABC"

ans =0
i=0
while i < n:
  if pat = s[i:len(pat)]:
    ans+=1

print(ans)

Fixed submission:
n = int(input())
s = input()
pat = "ABC"

ans = 0
i = 0
while i < n:
    if pat == s[i : i + len(pat)]:
        ans += 1
    i += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
import itertools


def checkArrays(arr1, arr2):
    if len(arr1) != len(arr2):
        return False

    for i in range(len(arr1)):
        if arr1[i] != arr2[i]:
            return False

    return True


n = int(input())

arrays = list(itertools.permutations([i for i in range(1, n + 1)]))

p = list(map(int, input().split()))
q = list(map(int, input().split()))

a = b = 1
for i in range(len(arrays)):
    ar = list(arrays[i])
    if checkArrays(ar, p):
        a = i + 1
    if checkArrays(ar, q):
        b = i + 1

print(abs(a, b))



Fixed submission:
import itertools


def checkArrays(arr1, arr2):
    if len(arr1) != len(arr2):
        return False

    for i in range(len(arr1)):
        if arr1[i] != arr2[i]:
            return False

    return True


n = int(input())

arrays = list(itertools.permutations([i for i in range(1, n + 1)]))

p = list(map(int, input().split()))
q = list(map(int, input().split()))

a = b = 1
for i in range(len(arrays)):
    ar = list(arrays[i])
    if checkArrays(ar, p):
        a = i + 1
    if checkArrays(ar, q):
        b = i + 1

print(abs(a - b))
Buggy python submission (verdict: Time Limit Exceeded):
def password():
    for i in range(10):
        for j in range(10):
            for k in range(10):
                yield [str(i), str(j), str(k)]


n = int(input())
s = input()

ans = 0
for perm in password():
    j = 0
    for i in range(n):
        if perm[j] == s[i]:
            j += 1
            if j >= len(perm):
                break
    if j >= len(perm):
        ans += 1

print(ans)


Fixed submission:
def password():
    for i in range(10):
        for j in range(10):
            for k in range(10):
                yield [str(i), str(j), str(k)]


n = int(input())
s = input()

ans = 0
for perm in password():
    if perm[0] in s:
        a = s.find(perm[0])
        if perm[1] in s[a + 1 :]:
            b = s[a + 1 :].find(perm[1])
            if perm[2] in s[a + 1 :][b + 1 :]:
                ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def password():
    for i in range(10):
        for j in range(10):
            for k in range(10):
                yield [str(i), str(j), str(k)]


n = int(input())
s = input()

ans = 0
for perm in password():
    j = 0
    for i in range(len(s)):
        if perm[j] == s[i]:
            j += 1
            if j >= len(perm):
                break
    if j >= len(perm):
        ans += 1

print(ans)


Fixed submission:
def password():
    for i in range(10):
        for j in range(10):
            for k in range(10):
                yield [str(i), str(j), str(k)]


n = int(input())
s = input()

ans = 0
for perm in password():
    if perm[0] in s:
        a = s.find(perm[0])
        if perm[1] in s[a + 1 :]:
            b = s[a + 1 :].find(perm[1])
            if perm[2] in s[a + 1 :][b + 1 :]:
                ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def password():
    for i in range(10):
        for j in range(10):
            for k in range(10):
                yield [str(i), str(j), str(k)]


n = int(input())
s = input()

ans = 0
for perm in password():
    j = 0
    for i in range(len(s)):
        if perm[j] == s[i]:
            j += 1
            if j >= len(perm):
                break
    if j >= len(perm):
        ans += 1

print(ans)

Fixed submission:
def password():
    for i in range(10):
        for j in range(10):
            for k in range(10):
                yield [str(i), str(j), str(k)]


n = int(input())
s = input()

ans = 0
for perm in password():
    if perm[0] in s:
        a = s.find(perm[0])
        if perm[1] in s[a + 1 :]:
            b = s[a + 1 :].find(perm[1])
            if perm[2] in s[a + 1 :][b + 1 :]:
                ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
from collections import deque

n = int(input())
graph = []

for i in range(n - 1):
    a, b = map(int, input().split())
    graph[a].append([b, i])
    graph[b].append([a, i])

ans = [0] * (n - 1)

q = deque([[1, 0, 0]])a

while q:
    node, pcol, p_node = q.popleft()
    cnt = 1
    for n_node in graph[node]:
        if n_node[0] == p_node:
            continue
        if cnt == pcol:
            cnt += 1
        ans[n_node[1]] = cnt
        q.append([n_node[0], cnt, node])
        cnt += 1

print(max(ans))
print(*ans, sep="\n")


Fixed submission:
from collections import deque

n = int(input())
graph = [[] for _ in range(n)]

for i in range(n - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    graph[a].append([b, i])
    graph[b].append([a, i])

ans = [0] * (n - 1)

q = deque([[1, 0, -1]])

while q:
    node, pcol, p_node = q.popleft()
    cnt = 1
    for n_node in graph[node]:
        if n_node[0] == p_node:
            continue
        if cnt == pcol:
            cnt += 1
        ans[n_node[1]] = cnt
        q.append([n_node[0], cnt, node])
        cnt += 1

print(max(ans))
print(*ans, sep="\n")
Buggy python submission (verdict: Runtime Error):
mod = 998244353
n = int(input())
d = list(map(int, input().split()))
d.sort()

if d[0] != 0:
    print(0)
    exit(0)

max_d = max(d)
cnt = [0] * (max_d + 1)

for num in d:
    cnt[num] += 1

if cnt[0] > 1:
    print(0)
    exit(0)

ans = 1

for i in range(1, len(cnt)):
    ans *= pow(cnt[i - 1], cnt[i], mod)
    an s %= mod

print(ans)


Fixed submission:
mod = 998244353
n = int(input())
d = list(map(int, input().split()))

if d[0] != 0:
    print(0)
    exit(0)

max_d = max(d)
cnt = [0] * (max_d + 1)

for num in d:
    cnt[num] += 1

if cnt[0] > 1:
    print(0)
    exit(0)

ans = 1

for i in range(1, len(cnt)):
    ans *= pow(cnt[i - 1], cnt[i], mod)
    ans %= mod

print(ans)
Buggy python submission (verdict: Runtime Error):
import heapq as hq

n,m = map(int, input().split())

items = [-1*map(int, input().split()] 

hq.heapify(items)
             
for i in range(m):
	pop = hq.heapqpop(items)
    hq.heapqpush(items, pop//2)
              
return -1*sum(hq)
  

Fixed submission:
import heapq
 
n,m = map(int, input().split())

items = list(map(lambda x:int(x)*(-1), input().split()))
heapq.heapify(items)
             
for i in range(m):
    pop = heapq.heappop(items)*(-1)//2
    heapq.heappush(items, pop*(-1))

print(-1*sum(items))
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input())

b - 1 = x * (a - 1)

if (b-1)%(a-1) == 0:
  print((b-1)//(a-1))
else:
  print((b-1)//(a-1) + 1)

Fixed submission:
a, b = map(int, input().split())

if (b - 1) % (a - 1) == 0:
    print((b - 1) // (a - 1))
else:
    print((b - 1) // (a - 1) + 1)
Buggy python submission (verdict: Runtime Error):
n = int(input())

ans = 0
for i in range(1, n+1):
  num = i
  digits=0
  while num:
    digits += 1
    num//=10
  if digit%2==1:
    ans+=1
    
print(ans)

Fixed submission:
n = int(input())

ans = 0
for i in range(1, n + 1):
    num = i
    digits = 0
    while num:
        digits += 1
        num //= 10
    if digits % 2 == 1:
        ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
def judgeAllBulbsOn(switchOn, conds, p):
  m = len(conds)
  flag = True
  for i in range(m):
    k = conds[i][0]
    numOfBulbOn = 0
    for i in range(k):
      if switchOn[conds[i][k]] == True:
        numOfBulbOn +=1
    if numOfBulbOn % 2 != p[m]:
      flag = False
      break
  return flag
      

#n:switch, m:bulb
n, m = map(int, input().split())

conds = []
for i in range(m):
  connect = list(map(int, input().split()))
  conds.append(connect)
  
p = list(map(int, input().split()))

switchOn = [False]*n

ans = 0
for bit in range(1<<n):
  for i in range(n):
    if bit & 1<<i == 1:
      switchOn[i] = True
    else:
      switchOn[i] = False
  if judgeAllBulbsOn(switchOn, conds, p):
    ans+=1
print(ans)

Fixed submission:
def judgeAllBulbsOn(switchOn, conds, p):
    m = len(conds)
    bulbOnFlag = True
    for i in range(m):
        k = conds[i][0]
        numOfSwitchOn = 0
        for j in range(1, k + 1):

            # switchOn is 0 - index
            if switchOn[conds[i][j] - 1] is True:
                numOfSwitchOn += 1
        if numOfSwitchOn % 2 != p[i]:
            bulbOnFlag = False
            break
    return bulbOnFlag


# n:switch, m:bulb
n, m = map(int, input().split())

conds = []
for i in range(m):
    connect = list(map(int, input().split()))
    conds.append(connect)

p = list(map(int, input().split()))

switchOn = [False] * n

ans = 0
for bit in range(1 << n):
    for i in range(n):
        if bit & 1 << i:
            switchOn[i] = True
        else:
            switchOn[i] = False
    if judgeAllBulbsOn(switchOn, conds, p):
        ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

u = [0] * n
v = [0] * n
w = [0] * n

color = [-1] * n
dist = [-1] * n
adj_list = [[] for _ in range(n)]

for i in range(n - 1):
    u, v, w = map(int, input().split())
    u -= 1
    v -= 1

    adj_list[u].append([v, w])
    adj_list[v].append([u, w])

q = []
dist[0] = 0
color[0] = 0
q.append(0)

while len(q) > 0:
    node = q.pop(0)

    for next, d in adj_list[node]:
        if dist[next] > 0:
            continue

        if dist[next] == -1 or dist[next] > dist[node] + d:
            dist[next] = dist[node] + d
            q.append(next)

for i in range(n):
    if dist[i] % 2 == 0:
        dist[i] = 0
    else:
        dist[i] = 1
    print(dist[i])


Fixed submission:
from collections import deque

n = int(input())

u = [0] * n
v = [0] * n
w = [0] * n

dist = [-1] * n
adj_list = [[] for _ in range(n)]

for i in range(n - 1):
    u, v, w = map(int, input().split())
    u -= 1
    v -= 1

    adj_list[u].append([v, w])
    adj_list[v].append([u, w])

q = deque()
dist[0] = 0
q.append(0)

while len(q) > 0:
    node = q.popleft()

    for next, d in adj_list[node]:
        if dist[next] > 0:
            continue

        if dist[next] == -1 or dist[next] > dist[node] + d:
            dist[next] = dist[node] + d
            q.append(next)

for i in range(n):
    if dist[i] % 2 == 0:
        dist[i] = 0
    else:
        dist[i] = 1
    print(dist[i])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

u = [0] * n
v = [0] * n
w = [0] * n

color = [-1] * n
dist = [-1] * n
adj_list = [[] for _ in range(n)]

for i in range(n - 1):
    u, v, w = map(int, input().split())
    u -= 1
    v -= 1

    adj_list[u].append([v, w])
    adj_list[v].append([u, w])

q = []
dist[0] = 0
color[0] = 0
q.append(0)

while len(q) > 0:
    node = q.pop(0)

    for next, d in adj_list[node]:
        if dist[next] > 0:
            continue

        if dist[next] == -1 or dist[next] > dist[node] + d:
            dist[next] = dist[node] + d

        q.append(next)

for i in range(n):
    if dist[i] % 2 == 0:
        dist[i] = 0
    else:
        dist[i] = 1
    print(dist[i])


Fixed submission:
from collections import deque

n = int(input())

u = [0] * n
v = [0] * n
w = [0] * n

dist = [-1] * n
adj_list = [[] for _ in range(n)]

for i in range(n - 1):
    u, v, w = map(int, input().split())
    u -= 1
    v -= 1

    adj_list[u].append([v, w])
    adj_list[v].append([u, w])

q = deque()
dist[0] = 0
q.append(0)

while len(q) > 0:
    node = q.popleft()

    for next, d in adj_list[node]:
        if dist[next] > 0:
            continue

        if dist[next] == -1 or dist[next] > dist[node] + d:
            dist[next] = dist[node] + d
            q.append(next)

for i in range(n):
    if dist[i] % 2 == 0:
        dist[i] = 0
    else:
        dist[i] = 1
    print(dist[i])
Buggy python submission (verdict: Runtime Error):
pat = ["A", "C", "G", "T"]

s = input()

left = right = 0
ans = 0

while left < len(s):
    right = left
    while s[right] in pat:
        right += 1

    ans = max(ans, right - left)

    left = right + 1

print(ans)


Fixed submission:
pat = ["A", "C", "G", "T"]

s = input()

left = right = 0
ans = 0

while left < len(s):
    right = left
    while right < len(s) and s[right] in pat:
        right += 1

    ans = max(ans, right - left)

    left = right + 1

print(ans)

Buggy python submission (verdict: Runtime Error):
pat = ["A", "C", "G", "T"]

s = input()

left = right=0
ans = 0

while left<len(s):
  right = left
  while s[right] in pat:
    right+=1
  
  ans = min(ans, right - left)
  
  left = right+1
  
print(ans)

Fixed submission:
pat = ["A", "C", "G", "T"]

s = input()

left = right = 0
ans = 0

while left < len(s):
    right = left
    while right < len(s) and s[right] in pat:
        right += 1

    ans = max(ans, right - left)

    left = right + 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())

ans = a
for i in range(a + 1, b + 1):
    ans ^= i

print(ans)

Fixed submission:
def xor_array(n):
    if (n + 1) % 4 == 0:
        return 0
    elif (n + 1) % 2 == 0:
        return 1
    elif n % 4 == 0:
        return n
    else:
        return 1 ^ n


a, b = map(int, input().split())
print(xor_array(a - 1) ^ xor_array(b))