There are six buttons in a row. Each button shows an arrow pointing left (L) or right (R). When you press a button, all buttons in the direction of its arrow (not including itself) rotate 180 degrees.
Find the least number of button presses required to get from RRRLLL to LRLRLR.
> > > < < <
[>] > > < < < <-- (1)
> < < > > >
> < < > [>] > <-- (2)
> < < > > <
> < [<] > > < <-- (3)
< > < > > <
< > < [>] > < <-- (4)
< > < > < >
There are other [4] pressed button solutions. Besides the
1, 5, 3, 4 solution as given above, there is the 5, 6, 1, 3 solution and may be more.
Edited on October 13, 2006, 8:28 am
|
Posted by Dej Mar
on 2006-10-13 08:03:23 |