In this problem, as in many other graph problems, we need a way to track visited squares. We used a set to solve this problem. However, do we need a set in this case? Is there another way to mark a square as visited?
Try to solve the problem without using an additional collection like a set. You can always reference the solution provided below.
Think about the type of square we never explore and how we can leverage that.

