Attenti Interview Question

the islands leet code problem