1. Obviously that we will have to exclude all rows until only 1 left. To exclude one row, we will have to try C/W times to ensure that is the case, and it is not possible to hide it in that row.

  2. Now that we have only 1 row left, where to put the first guess? No obvious answer from here

  3. Now think the complimentary case, if the first guess is hit, we should try its immediate neighbors, because

1. If it is a hit, we did not waste the turn, i.e., we are still on the path to the optimal solution

2. If it is a miss, we immediately hit the boundary, and because we know W, we immedately know the remaining cells

3. i.e., once the first hit is announced, we will waste only 1 turn, which is optimal (Otherwise, it would be we are always correct,
contracting the fact opponent can move ship)

  1. From discussion on 3, we know we have to delay the first hit as much as possible, since min # of misses on a row is C/W before we know the ship doesnt exist, we must try all C/W hits,one of them will be a hit, which leads us to insight 3)

My solution is uses a game theory-ish solution, passed sample but failed even the small case, because I missed insight 3. What I should have done is the walk through the test case by hand first to gain additional insight