Skip to content

Commit

Permalink
Time: 2918 ms (5.01%), Space: 20.9 MB (98.98%) - LeetHub
Browse files Browse the repository at this point in the history
  • Loading branch information
hovanhoa committed Oct 18, 2023
1 parent da4d63d commit 001b23c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions 2428-equal-row-and-column-pairs/2428-equal-row-and-column-pairs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class Solution:
def getRow(self, grid: List[List[int]], num: int) -> List[int]:
res = []
for i in grid:
res.append(i[num])

return res

def equalPairs(self, grid: List[List[int]]) -> int:
ans = 0

for i in range(len(grid)):
for j in range(len(grid)):
if grid[i] == self.getRow(grid, j):
ans += 1

return ans

0 comments on commit 001b23c

Please sign in to comment.