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: Submission #82867892 - Codeforces
Question : Problem - D - Codeforces
I still failed pretest 4. Can anyone help and explain what is wrong with my code. Thanks!