Run time error in Depth first search question

Question link:https://leetcode.com/problems/surrounded-regions/

My code gives SIGGSEGV error on geeks for geeks ide but runs fine in ideone ide. How is this possible ?? Can someone find the runtime error ?? Same code runs on one ide perfectly and fails on another ide.??

LInk to ideone code >>https://ideone.com/vL9jl9

Link to geeks ide code >>https://ide.geeksforgeeks.org/UHIK1Tjt0P

When I reduce the size of array to 100 i.e. int visited[100][100]; it runs successfully. It seems that Ideone IDE has more memory as compared to Geek for Geeks.

1 Like

Yep you are right ,thanks !!!