you have an axis of integers, it's infinitely long, going from negative to positive(so there are points like -2, -1, 0, 1, 2 etc on it), there is a battleship travelling at constant velocity(integer) in a constant direction. But you don't know what the velocity is nor the direction nor the starting point of the ship. Each move you can shoot at a point and you will be told if u hit it or not. The question is, can you hit the ship in finite amount of moves?

My solution

lets have a pair (s,v) where s is the start location, v is the speed. so at time t, the ship would be at s+vt if it started at s, and has velocity v. then we arrange all possible (s,v) in an infinite list.. (s_n,v_n) for example, make it spiral outwards in the 2d lattice, or complete all those that |s|<m, v<|m|, before moving to | s | =m. then for each t, just search s_t + t*v_t. then within finite time, the ship will be found. so this requires O( max(s,v)^2 ) to find that ship, one can probably do better by reducing some redundant checks, but im pretty sure this works already.