← BNY Mellon questions

Minimum adjacent swaps to make array good

Filed under BNY Mellon

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.

Related BNY Mellon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.