Scotiabank interview question

Leetcode Number of Islands (Medium)