Your question is Search on the Line. Take a moment with it on the right.
Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).
You are at 0 on the real line. A flag is planted at an integer coordinate, but you do not know where or which direction. Is there an algorithm to find the flag in time linearly dependent on the distance from the origin?