Problem 44376. The sliding puzzle: 3D
Solution Stats
Problem Comments

8 Comments
there is a bug in the evaluation function, I believe "abs(a1 + b1 + c1  a0  b0  c0) == 1" should be changed to "abs(a1a0) + abs(b1b0) + abs(c1c0) == 1". In any way, this was a very cool problem, unless I am misremembering this would be the very first one that forced me to implement some version of A* in Cody :)
Alfonso, it is an honor and a pleasure to have read your comment. I'm glad you enjoyed the problem. Thank you for spotting the bug. I will update accordingly.
Alfonso, I've fixed the bug. As a result, I've actually located a tiny typo, one single character in my own solution that was, in fact, the difference between a correct and an incorrect solution based on your correction. Fixed that too, of course. Thanks again!
It takes 9 seconds to solve the four inputs on my laptop, but the system rejected my code with the error of long run time. What's the acceptable time for the four inputs?
This one kept my busy, and I think my solution is a bit of a tour de force. It is recipe based, rather than optimal, but there are just too many corner cases to program around. I should have made better use of invariant sets, I guess.
Difficult problem
Good problem. Tip: use the L1norm or manhattan distance using the 3 indexes as a cost function.
I am actually giving up :(
tried a lot......
Solution Comments
Show commentsProblem Recent Solvers49
Suggested Problems

1863 Solvers

Get the area codes from a list of phone numbers
1047 Solvers

Reverse the Words (not letters) of a String
434 Solvers

Sum all integers from 1 to 2^n
14647 Solvers

Flag largest magnitude swings as they occur
673 Solvers
More from this Author45
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!