There are 16 baskets: 4 red, 4 blue, 4 green and 4 black. Each basket contains a ball from one of the 4 colours (see image). You can pick up a ball from one basket and swap it with a ball from another basket. What is least number of swaps needed to make every basket contain a ball of the same colour as the basket?
If the baskets are named with the rows and columns:
A B C D E F G H I J K L M N O P
I will first try and swap the baskets' containers where the two will be solved with just 1 swap:
A<->E, J<->K, F<->O, G<->P
Then finish the puzzle with the smallest number of swaps:
D<->L, D<->H, B<->D
So the smallest number of swaps needed is
<-> is a swap, e.g.
A<->B is basically swapping whatever's in A to B.