Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 491 Bytes

File metadata and controls

14 lines (10 loc) · 491 Bytes

Problem 12: The Knight's Tour (Knight's Tour Problem)

Problem Statement

Given an N x N chessboard, find a sequence of moves of a knight such that the knight visits every square exactly once. If a complete tour exists, print the board showing the order of visits.

Input Format

  • An integer N (size of the chessboard).

Constraints

  • 1 <= N <= 8

Example

Input: N = 5
Output: A 5x5 matrix showing the order in which each cell is visited (0-indexed or 1-indexed).