Given a matrix representing a battleship board, count the number of battleships present. Battleships are placed horizontally or vertically and are not adjacent to each other.
Click Run to execute sample tests.