LC: 1197. Minimum Knight Moves
Input: x = 2, y = 1
Output: 1
Explanation: [0, 0] → [2, 1]Input: x = 5, y = 5
Output: 4
Explanation: [0, 0] → [2, 1] → [4, 2] → [3, 4] → [5, 5]Last updated
Input: x = 2, y = 1
Output: 1
Explanation: [0, 0] → [2, 1]Input: x = 5, y = 5
Output: 4
Explanation: [0, 0] → [2, 1] → [4, 2] → [3, 4] → [5, 5]Last updated
class Solution {
public int minKnightMoves(int x, int y) {
}
}