Fridge Magnets-b

Jenny is obsessed with keeping shapes together. The refrigerator in her house has magnets of two shapes on the door: green squares and blue circles. Jenny wants all squares together and all circles together.

Someone has messed up the magnets.

Question:

How many swaps will it take Jenny to restore order?

Note:

• A swap is where you swap the positions of a square and a circle.

• It doesn’t matter whether squares are on the left or the right: choose whichever one that will lead to the smallest number of swaps.

• In a swap the square and the circle do not have to be side by side.