Wayfair interview question

Code knights tour algorithm