Question 61
HardWhat is the output of this code?
def count_inv(a):
(a) < :
a,
m = (a) //
l, x = count_inv(a[:m]); r, y = count_inv(a[m:])
out, i, j, inv = [], , , x + y
i < (l) j < (r):
l[i] <= r[j]:
out.append(l[i]); i +=
:
out.append(r[j]); j += ; inv += (l) - i
out + l[i:] + r[j:], inv
(count_inv([, , , ])[], count_inv([, , , , ])[])