Given an array A of size 2n where each pair of adjacent elements at even-odd indices should be equal (i.e., A[2*i] = A[2*i+1]), find the minimum number of adjacent swaps needed to achieve this, or…
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.