Sliding Coins

Three pennies and three nickles are arranged in a row. The pennies are red and nickles are green in color. The goal is to move them so that the coins are again in a row, with all pennies to the right and nickels to the left.

sliding coins puzzle

Each move consists of moving a pair of adjacent coins, and sliding those two coins to a new position without rotating the coins. How can you achieve this (shown below) in three moves?

sliding coins goal

Answer

sliding coins answer