Amazon Interview Question

leetcode on number of islands