Relative Content

Tag Archive for programming-logic

Finding an object on an infinite line

Question: There is an infinite line. You are standing at a particular point you can either move 1 step forward or 1 step backward. You have to search for an object in that infinite line. Your object can be in any direction. Give an optimal solution My approach: Go 1 step forward, 2 step back […]