← Questions
Sliding puzzle on a 2 by 3 board
0
I was asked this
No reports yet. Sign in to say where you were asked it.
A 2 by 3 board holds tiles 1 to 5 and one empty cell. A move slides a tile next to the empty cell into it. Return the fewest moves to reach the solved board, or -1 if it cannot be solved. Encode each board as a string and run a breadth-first search over states.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
