This problem is very classical, it can like the forest which is convert a big problem into some small problem. The question is to let us find the max. area, so what is max. area? In here, it means that will need to find max. area which has most validate(= 0) neighbor, then stop it spread out and add the wall, here is another tricky part. So what I did is first find the max. area which has most neighbor by BFS, then add wall, and repeat. Here, we need to use many struct to store our info.: use a vector of set to store our locations of one area, a integer to store the max. area, a vector to store current map is visited or not, a vector to store current neighbor is check or not in this round.
Error:
1. We need to use a visited vector to check current virus is visited or not in each while loop
2. Add a visited vector to check current neighbor is visited or not in current BFS
3. After searching, first handle max. area, then simulate the other