Robot movement on a grid

question:- https://hack.codingblocks.com/practice/p/406/1296
solution:- https://ide.codingblocks.com/s/115207
giving wrong answer. help!!!