WEX interview question

Question was an uncommon medium leetcode problem - Movement of Robots.