Tap here to switch tabs
Problem
Submissions

Problem: Even Number of Knight Moves

Even Number of Knight Moves asks whether a knight can travel between two coordinates on an eight-by-eight chessboard in an even number of legal moves, returning true or false.

Statement

You are given two integer arrays start and target of length 22, representing the coordinates of a knight on an 8×88 \times 8 chessboard.

Return true if the knight can reach target from start in an even number of moves, or false otherwise.

Note: In a single move, a knight can move 22 squares in one direction horizontally or vertically and 11 square in the perpendicular direction.

Constraints:

  • start.length ==== target.length ==2== 2

  • 0≤0 \leq start[i], target[i] ≤7\leq 7

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Even Number of Knight Moves

Even Number of Knight Moves asks whether a knight can travel between two coordinates on an eight-by-eight chessboard in an even number of legal moves, returning true or false.

Statement

You are given two integer arrays start and target of length 22, representing the coordinates of a knight on an 8×88 \times 8 chessboard.

Return true if the knight can reach target from start in an even number of moves, or false otherwise.

Note: In a single move, a knight can move 22 squares in one direction horizontally or vertically and 11 square in the perpendicular direction.

Constraints:

  • start.length ==== target.length ==2== 2

  • 0≤0 \leq start[i], target[i] ≤7\leq 7