A POSSIBLE SOLUTION - Go left and then right of a starting point and increase the distance exponentially i.e. 1km left then 1 km right ..next time increase distance 2 km left and then 2km right.
If 'n' denotes the shortest distance ,time complexity will be O(2n).
PS:A KM movement is taken as a unit of operation.
64.3k questions
77.9k answers
244k comments
80.0k users