Pregunta de entrevista de Credit Karma

Robot Grid question on Leetcode