Skip to content

Commit f057f1d

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 57adc57 commit f057f1d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

matrix/transitive_closure.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def transitiveClosure(graph):
2525
n = len(graph)
2626
ans = [[graph[i][j] for j in range(n)] for i in range(n)]
2727

28-
# Transtive closure of (i, i) will always be 1
28+
# Transtive closure of (i, i) will always be 1
2929
for i in range(n):
3030
ans[i][i] = 1
3131

@@ -34,15 +34,15 @@ def transitiveClosure(graph):
3434
for k in range(n):
3535
for i in range(n):
3636
for j in range(n):
37-
38-
# Check if a path exists between i to k and
37+
# Check if a path exists between i to k and
3938
# between k to j.
4039
if ans[i][k] == 1 and ans[k][j] == 1:
4140
ans[i][j] = 1
4241

4342
return ans
4443

44+
4545
if __name__ == "__main__":
4646
import doctest
4747

48-
doctest.testmod()
48+
doctest.testmod()

0 commit comments

Comments
 (0)