# Problem Definition

## Description

Given a 2d grid map of `'1'`s (land) and `'0'`s (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally, vertically or diagonally. You may assume all four edges of the grid are all surrounded by water.

**Example 1:**

```plaintext
Input:
11110
11010
11000
00000

Output: 1
```

**Example 2:**

```plaintext
Input:
11000
11000
00100
00011

Output: 1
```

**Example 3:**

```plaintext
Input:
11011
00010
00100
11001

Output: 3
```

## Notes

1. [Geeks for Geeks - Find the number of islands | Set 1 (Using DFS)](https://www.geeksforgeeks.org/find-number-of-islands/)
1. [LeetCode discussion - Java DFS and BFS solution](https://leetcode.com/problems/number-of-islands/discuss/56338/Java-DFS-and-BFS-solution)
1. [LeetCode article](https://leetcode.com/articles/number-of-islands/)