Simulate rover movement on a grid | Shopify Interview Question