Given a square chessboard of size N x N, the initial position of a Knight and the position of a target. Find out the minimum steps a Knight will take to reach the target position.
{
"KnightPos": [
4,
5
],
"TargetPos": [
1,
1
],
"N": 6
}3{
"KnightPos": [
1,
1
],
"TargetPos": [
1,
1
],
"N": 4
}0{
"KnightPos": [
1,
1
],
"TargetPos": [
2,
2
],
"N": 4
}4Sign in to Run Code and Submit