419. Battleships in a Board (Medium)