Solved surrounded region problem with an BFS method