solution to Surrounded Regions