Robot In A Grid Leetcode Javascript Practice