Amazon interview question

Identifying islands in water leetcode