There are n couples sitting in 2n seats in a row, given as 'row' where row[i] is the person in seat i. Couples are (0,1), (2,3), ..., (2k, 2k+1). In one swap you exchange any two people. Return the minimum number of swaps so that every couple sits in adjacent seats. The input is JSON {row}.
Input: JSON {row}.
Output: Integer — the minimum number of swaps.
Input: {"row":[0,2,1,3]}
Output: 1
Explanation: One swap seats both couples together.Input: {"row":[3,2,0,1]}
Output: 0
Explanation: Already paired.Input: {"row":[0,1]}
Output: 0
Explanation: A single couple already adjacent.2<=2n<=60