P&C 2103: rearranging people

In this question, we rearrange a group of people consisting of some married couples in a line/circle, under the following conditions:

  • no restrictions
  • each married man stands next to his wife
  • men and women alternate
  • each married man stands next to his wife and the men and women alternate

App preview

Access the app at https://2101.vercel.app.