Solve Knight and Reversal Problems | Uber Coding Question