flag = flag and dfs(i + x, j + y) evaluating differently from flag &= dfs(i + x, j + y)
I was working on the leetcode problem Count Sub Islands and encountered a very odd Python behavior.
Logical operators, short circuit evaluation, and the print() function in python 3.x
I’m trying to understand what is actually going on with this code: