NewsBreak Interview Question

A question similar to leetcode num islands.