leetcode
419. Battleships in a Board
Solution code
Time complexity: O(n m)
Space complexity: O(1)