JAVA: Task: create a function called “knight” to represent thechess game. This function will show the shortest path to get fromone square to another square. Do this by outputting all squares theknight will stop on along the way. Using infinite series searchalgorithm.
Output could look like:
You made it in 2 moves–>
[2,3]
[4,4]
Answer