Can you align all of the coins on the right edge of the board?
The Python 🐍 problem-solving bootcamp is starting soon. Join the second cohort now!
The diagram above shows a 3 by 4 grid with 3 coins, one per row and one per column, such that the rightmost column of the grid is empty.
You are allowed to slide the coins to the columns on their right, but the coins can never leave the board (nor can they be moved back to the left). Also, you always have to move two coins at a time.
Thus, this is a legal move:
But moving a single coin, such as in the diagram below, is not allowed:
Your objective is to reach this position:
Can you do it?
What if you extend the board two columns to the left and two rows up, and add another two coins along the diagonal?
Give it some thought!
This is an adaptation of a problem from the book “Algorithmic Puzzles” by Anany Levitin and Maria Levitin.1
Congratulations to the ones that solved this problem correctly and, in particular, to the ones who sent me their correct solutions:
Know how to solve this? Join the list of solvers by emailing me your solution!
The solution to this problem will be shared when this problem has been live for approximately two weeks, which should be in late June.
Don't forget to subscribe to the newsletter to get bi-weekly problems sent straight to your inbox.
This is an Amazon Affiliate link and I may earn a commission if you purchase the book. This comes at no extra cost to you. ↩
I write about Python every week. Join +16.000 others who are taking their Python 🐍 skills to the next level 🚀, one email at a time.