✅ why is it '1' instead of '0'??
So I am analysing this solution https://leetcode.com/problems/number-of-islands/solutions/3585795/c-flood-fill-solution-beats-90-easy-to-understand-clean/?envType=study-plan&envId=level-1&plan=leetcode-75
Just one block of code puts me off very much:
`
Why is the code like this, if the grid is painted '1' then the grid turns '0'? I tried to play around with this block for understanding it (swap '0' and '1' or set both of the chars to '1' '1' etc), my try led to stack overflow.
Just one block of code puts me off very much:
`
Why is the code like this, if the grid is painted '1' then the grid turns '0'? I tried to play around with this block for understanding it (swap '0' and '1' or set both of the chars to '1' '1' etc), my try led to stack overflow.
LeetCode
View shayke223's solution of Number of Islands on LeetCode, the world's largest programming community.
