there n couple sit 2n seat arrange row want hold handsthe people seat represent integer array row rowi ID person sit ith seat the couple number order couple 0 1 second couple 2 3 couple 2n 2 2n 1return minimum number swap couple sit a swap consist choose people stand switch seat Example 1input row 0213output 1explanation we need swap second row1 row2 personexample 2input row 3201output 0explanation all couple seat Constraints2n rowlength2 n 30n even0 rowi 2nall element row unique