Intuit interview question

Number of islands leetcode question