776 - Monkeys in a Regular Forest
Solution Description : Flood Fill problem Maximum Row Length<=1000 ,and Maximum Column Length<=1000 Input all char to forest[1000][1000] This is a 8-way flood fill problem (i, ,j-1), (i, j+1), (i-1, j), (i+1, j), (i-1, j-1), (i-1, j+1), (i+1, j-1), and (i+1, j+1) If you got any character then run flood fill for this character. in flood fill set forest[i][j]='.'. At last you need to set output formatting. |
||||||||||