You will be given a list of dancing couples, with the woman first and man second, as well as a parameter "men" or "women".
"men", the men reverse their positions (first moves to last, last moves to first, etc), while women keep their positions."women", the women reverse their positions, while men keep their positions.dance([
[Ana, Bob],
[Amy, Josh],
[Lisa, Tim]
], men) ➞ [
[Ana, Tim],
[Amy, Josh],
[Lisa, Bob]
]
dance([
[Ana, Bob],
[Amy, Josh],
[Lisa, Tim]
], women) ➞ [
[Lisa, Bob],
[Amy, Josh],
[Ana, Tim]
]
Input lists will always be the same length.