The matrix is not formatted properly in terminal-leetcode.
<div class="question-description">
--
| <p><p>Given a 2d grid map of <code>'1'</code>s (land) and <code>'0'</code>s (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water.</p>
|
| <p><i><b>Example 1:</b></i></p>
| <pre>11110<br>11010<br>11000<br>00000</pre>
| <p>Answer: 1</p>
| <p><i><b>Example 2:</b></i></p>
| <pre>11000<br>11000<br>00100<br>00011</pre>
| <p>Answer: 3</p>
|
| <p><b>Credits:</b><br />Special thanks to <a href="https://leetcode.com/discuss/user/mithmatt">@mithmatt</a> for adding this problem and creating all test cases.</p></p>
| </div>
The matrix is not formatted properly in terminal-leetcode.
HTML source: