Pergunta de entrevista da empresa NewsBreak

A question similar to leetcode num islands.