Microsoft Interview Question

Number of islands coding problem