Jump to content
BrainDen.com - Brain Teasers

Shashank

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by Shashank

  1. For a 2x2 maze, the sequence will be Left- Right- Left Let's assume our maze is a b c d The robot is standing at a, facing downward at c. As per the question, there will a path from a to d, so there could be cement on "b" or "c" or no cement at all. Also, there is cement outside the grid so the robot cannot move out of the grid. Case1- Let's assume that the cement is in "b" and apply the commands- Left- The robot will turn towards "b" and hit the wall Right- It will move towards "c" Left- It will move towards "d"- its destination Case 2- Let's assume that cement is in "c" and apply the commands Left- It will move towards "b" Right- It will move towards "d" Left- It will hit the cement outside the grid and will stay at the same place "d" Case 3- Let's assume that there are no cement blocks The movement will be same as in case 2 I hope this is acceptable as a solution
×
×
  • Create New...