Pergunta de entrevista da empresa Huawei Technologies

Solve the isolated island question in Java 2D array