Knight's tour
Last updated
Last updated
You are given a chess-board and a starting point co-oridnates. You are given a knight, which starts at the starting point. You've to check whether the knight can visit all the spots in the chess-board.
Input Format:
N (integer) - size of 2-d array
X (integer) - x-coordinate of starting point
Y (integer) - y-coordinate of starting point Constraints
0 <= N <= 5
0 <= X < N
0 <= Y < N
Output Format: true or false
Sample Input: 5 0 0
Sample Output: true