I tried exactly what the editorial said. I made all the blocks surrounding B to be #. Then, checked if every G can reach the end or not. Here’s my solution: https://codeforces.com/contest/1365/submission/82867892
I still failed pretest 4. Can anyone help and explain what is wrong with my code. Thanks!