-
Notifications
You must be signed in to change notification settings - Fork 20k
Flood fill fills diagonally & errors if edges are to be filled #2836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
IMO filling diagonally is fine, it's one of the ways it can be implemented. As for the check, could you fix that and maybe add a test for that? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
What the heck, issues don't resolve themselves. The bot should be disabled. |
Should this not be categorised as a Backtracking problem, rather than dynamic programming? |
Flood fill is indeed often categorized as backtracing. That's a different issue though: This issue is about a possible crash in the implementation. |
Agreed. The corner case is not covered for the function going beyond the dimensions of the 2D array. |
Since this issue is still unresolved for months, would be happy to take over this one. Would be covering the missing corner case, add a few test cases (asserts I believe?), and if it's okay, would like to move this code under the backtracking directory/category. |
1f17076
It:
x < width && y < height
: I assume it crashes if that happens (with an AIOOB Ex.)The text was updated successfully, but these errors were encountered: