Expedia Group Interview Question

number of islands variant from leetcode