Citadel interview question

Minimum knight moves coding question on hacker rank