You have 10 coins: five heads, then five tails, all in a row.
HHHHHTTTTT (H is for heads and T is for tails.)
In each move, you can take two adjacent coins and move them somewhere else. You cannot switch the coins as you move them, and you may not move other coins. (This includes spreading them apart to make room!)
If all ten coins are in a row, then you may move a group of two to either end. Otherwise, your next move must fill the gap left by the previous move.
How can you get them to alternate (either
THTHTHTHTH) in just 5 moves?
Here's an example game that does not succeed:
Start: H H H H H T T T T T
1: H H H H - - T T T T H T
2: H - - H H H T T T T H T
3: H T H H H H T T T - - T
4: H T T H H H T T H T
Any move from the last position would take coins out of the middle, so the last move cannot succeed in putting the coins adjacent to each other.