Skip to content

Commit 52e8f41

Browse files
committed
Runtime: 3042 ms (Top 71.65%) | Memory: 50.4 MB (Top 92.27%)
1 parent da182bc commit 52e8f41

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/algorithms/R/Rank Transform of a Matrix/Rank Transform of a Matrix.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Runtime: 3042 ms (Top 71.65%) | Memory: 50.4 MB (Top 92.27%)
12
class Solution:
23
def matrixRankTransform(self, matrix: List[List[int]]) -> List[List[int]]:
34
m, n = len(matrix), len(matrix[0])
@@ -13,7 +14,7 @@ def find(i):
1314
def union(i,j):
1415
pi, pj = find(i), find(j)
1516
p[pi] = pj
16-
newrank[pj] = max(newrank[pi], newrank[pj])
17+
newrank[pj] = max(newrank[pi], newrank[pj])
1718
for e in sorted(d):
1819
p = list(range(m+n))
1920
newrank = rank[:]

0 commit comments

Comments
 (0)