← Problem book: Python
Lesson 23 of 96 · 15 XP
Knight move
Theory and problem statement
Machine translation, not yet reviewed by a native speaker.
You are given two different squares of a chessboard (as in the rook problem). Print YES if a knight can move
from the first to the second in one move, otherwise NO. A knight moves in an “L” shape: 2 squares in one direction and 1 in the other.
Example
Input:
1 1 2 3
Output:
YES
Sign up for free to solve this task right in your browser: code editor, running, test checks and hints.