Amazon Interview Question

Number of islands (problem on leetcode)