Flood fill ques run-error

Run time erroe on second case.why?

@amitrao Please save your code on ide.codingblocks.com and share its link.

https://ide.codingblocks.com/s/177755 here is the code

Run error was due to array index out of bounds. I have increased the size of your array.

Check now.

showing wrong answer now.

2nd test case is not passing with this code.

For test case:
40
54 54 54 25 25 25 25 25 25 25 25 25 25 10 10 10 10 10 10 10 10 10 62 22 22 22 22 22 22 17 17 17 17 50 39 39 39 1 15 62

Expected O/p is 13
Your O/p is 14

There is some issue with your approach.


Refer this video.This may help.