There are
The people and seats are represented by an integer array row of length row[i] is the label of the person sitting in the
Return the minimum number of swaps needed so that every couple is seated side by side. A single swap consists of choosing any two individuals and having them exchange their seats.
Constraints:
row.length
row[i]
All the elements of row are unique.
There are
The people and seats are represented by an integer array row of length row[i] is the label of the person sitting in the
Return the minimum number of swaps needed so that every couple is seated side by side. A single swap consists of choosing any two individuals and having them exchange their seats.
Constraints:
row.length
row[i]
All the elements of row are unique.