WA in GRID

Can anyone please tell me what is wrong with this approach or suggest a test case where it fails

https://www.codechef.com/viewsolution/36868796 See my solution U dont need to use a char array just verify that the char is # and store a value -1 in a number 2d array and then run two loops of two loops i.e one starting from end column to first column and if there occurs a rock then flag it and make all values too the left -1 similarly go bottom to top and do the same … I think this should help u a bit @a

1 Like