We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6a7571c commit 2ddcd2fCopy full SHA for 2ddcd2f
Python/minimum-flips-in-binary-tree-to-get-result.py
@@ -18,10 +18,12 @@ def minimumFlips(self, root, result):
18
:rtype: int
19
"""
20
INF = float("inf")
21
- OP = {2: lambda x, y: x or y,
22
- 3: lambda x, y: x and y,
23
- 4: lambda x, y: x^y ,
24
- 5: lambda x, y: not x if x is not None else not y}
+ OP = {
+ 2: lambda x, y: x or y,
+ 3: lambda x, y: x and y,
+ 4: lambda x, y: x^y ,
25
+ 5: lambda x, y: not x if x is not None else not y
26
+ }
27
28
def iter_dfs(root, result):
29
ret = collections.defaultdict(lambda: INF)
@@ -64,10 +66,12 @@ def minimumFlips(self, root, result):
64
66
65
67
68
69
70
71
72
73
74
75
76
def dfs(node):
77
if not node:
0 commit comments