Write a search algorithm to move a chess knight on an infinite chess board.
Asked in the Coding Round stage. Algorithmic coding problem given during a Google technical interview.
Implement knight_shortest_path(start, target), where start and target are two-element integer lists [x, y]. Return a list of board coordinates beginning with start and ending with target, representing a shortest valid knight path. If both positions are equal, return a list containing that position.
start and target each contain exactly two integersdef knight_shortest_path(start, target):