Pergunta de entrevista da empresa Credit Karma

Robot Grid question on Leetcode