Compute island size in grid | Apple