X Interview Question

Question with finding islands within nested arrays