Skip to content

Commit 2ddcd2f

Browse files
authored
Update minimum-flips-in-binary-tree-to-get-result.py
1 parent 6a7571c commit 2ddcd2f

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

Python/minimum-flips-in-binary-tree-to-get-result.py

+12-8
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ def minimumFlips(self, root, result):
1818
:rtype: int
1919
"""
2020
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}
21+
OP = {
22+
2: lambda x, y: x or y,
23+
3: lambda x, y: x and y,
24+
4: lambda x, y: x^y ,
25+
5: lambda x, y: not x if x is not None else not y
26+
}
2527

2628
def iter_dfs(root, result):
2729
ret = collections.defaultdict(lambda: INF)
@@ -64,10 +66,12 @@ def minimumFlips(self, root, result):
6466
:rtype: int
6567
"""
6668
INF = float("inf")
67-
OP = {2: lambda x, y: x or y,
68-
3: lambda x, y: x and y,
69-
4: lambda x, y: x^y ,
70-
5: lambda x, y: not x if x is not None else not y}
69+
OP = {
70+
2: lambda x, y: x or y,
71+
3: lambda x, y: x and y,
72+
4: lambda x, y: x^y ,
73+
5: lambda x, y: not x if x is not None else not y
74+
}
7175

7276
def dfs(node):
7377
if not node:

0 commit comments

Comments
 (0)