There are 5 green frogs on the left side of the swamp and 5 blue frogs on the right side of the swamp. They are sitting on rocks. The central rock is empty.
###### This problem is inspired by a game I watched my kids play.

Your task is to swap their places. i.e.: at the end the 5 blue frogs should be on the left, the 5 green frogs should be on the right and the central rock should be free.

Each frog can only move forward. The direction of travel is shown by the respective arrows.

A frog can advance by one step, if the space in front of it is free.

A frog can jump over another, only if the other frog is of the other color. You can jump over only one frog of other color at a time into the vacant space immediately behind it.

How many moves would it take for the green and blue frogs to swap places?

Can you generalize for \(n\) frogs on either side?

×

Problem Loading...

Note Loading...

Set Loading...