Attenti interview question

the islands leet code problem