Minimum Knight Moves
Medium · Queue & Deque · about 25 minutes
Asked at Google, Apple, Uber, Databricks, LinkedIn, Confluent, Cohere.
A knight sits at [0, 0] on a chessboard with no edges. What is the smallest number of knight moves that brings it to [x, y]? (|x| + |y| <= 300.)