Puzzle | Can a Knight reach bottom from top by visiting all squares Last Updated : 22 Jul, 2024 Comments Improve Suggest changes Like Article Like Report PuzzleIs there a way for a chess knight to start at the top-left corner from a N x N chessboard, visit all the squares of the board exactly once and end at the lower-right corner. SolutionWe need to traverse all the squares of the chessboard exactly once. Also, the moves of the knight are L-shaped, that is, traverse two squares vertically or horizontally. A simple observation to take from this is that in one move, the knight starts and ends at two different colored squares. Consider two cases: Case N is even: Let the value of N be 8. Hence, total number of squares on the board will be 64. Now, to visit all the squares of the board exactly once the knight would have to make 63 moves. Since, total number of moves are odd, the journey will start and end on the squares of the opposite color. Since, the squares on the top-left corner and lower-right corner are both coloured the same, hence the journey is impossible. Case N is odd: Let the value of N be 9. Hence, total number of squares on the board will be 81. Now, to visit all the squares of the board exactly once the knight would have to make 80 moves. Since, total number of moves are even, the journey will start and end on the squares of the same color. Since, the squares on the upper-left corner and lower-right corner are of the same color, hence the journey on 9 x 9 board is possible. But for N = 3, this is no solution as the knight cannot reach (2,2) position (which is the middle of chessboard). Hence, on a N x N chessboard, a knight will have to make (N2 - 1) moves to visit each square exactly once. So, if N is even, the journey is impossible and for odd values of N, the journey is possible. Comment More infoAdvertise with us Next Article Puzzle | Can a Knight reach bottom from top by visiting all squares C CharchitKapoor Follow Improve Article Tags : Aptitude Analytical Mathematical Puzzles chessboard-problems Similar Reads Count of all possible ways to reach a target by a Knight Given two integers N, M denoting NÃM chessboard, the task is to count the number of ways a knight can reach (N, M) starting from (0, 0). Since the answer can be very large, print the answer modulo 109+7. Example: Input: N =3, M= 3Output: 2Explanation: Two ways to reach (3, 3) form (0, 0) are as foll 10 min read Puzzle - Ways to Reach Bottom Right in 6x6 Grid You begin in the top left corner of a 6x6 grid, and your objective is to move to the bottom right corner. There are just two directions you can move: right or down. Both diagonal and backward movements are prohibited. How many different ways are there to get from the start to the finish?PuzzleWe can 3 min read Minimum steps to reach target by a Knight | Set 1 Given a square chessboard of n x n size, the position of the Knight and the position of a target are given. We need to find out the minimum steps a Knight will take to reach the target position.Examples: Input: KnightknightPosition: (1, 3) , targetPosition: (5, 0)Output: 3Explanation: In above diagr 9 min read Minimum steps to reach target by a Knight | Set 2 Given a square chessboard of N x N size, the position of Knight and position of a target is given, the task is to find out the minimum steps a Knight will take to reach the target position. Examples : Input : (2, 4) - knight's position, (6, 4) - target cell Output : 2 Input : (4, 5) (1, 1) Output : 15+ min read Print all Knight's tour possible from a starting point on NxN chessboard Given a N x N chessboard with a Knight initially standing on the Xth row and Yth column, the task is to print all possible paths such that the knight must visit each square exactly once. Example: Input: N = 5, X = 1, Y = 1Output: 1 6 15 10 21 14 9 20 5 16 19 2 7 22 11 8 13 24 17 4 25 18 3 12 23 1 6 15+ min read Like