IMC Trading Interview Question

Battleship problem