Microsoft Interview Question

A 2d array question about connected islands.