Knight’s Shortest Path on Chessboard
EDIT: See simon’s answer, where he fixed the formula presented here. Actually there is an O(1) formula This is an image that I’ve made to visualize it ( Squares a knight can reach on Nth move are painted with same color ). Can you notice the pattern here? Although we can see the pattern, it … Read more