Skip to content

Commit 5918913

Browse files
iamAntimPalAntim-IWPIamShiwangi
committed
Create 2352. Equal Row and Column Pairs.py
Co-Authored-By: Antim-IWP <[email protected]> Co-Authored-By: Shiwangi Srivastava <[email protected]>
1 parent cd8e7f7 commit 5918913

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Solution:
2+
def equalPairs(self, grid: List[List[int]]) -> int:
3+
n = len(grid)
4+
ans = 0
5+
for i in range(n):
6+
for j in range(n):
7+
ans += all(grid[i][k] == grid[k][j] for k in range(n))
8+
return ans

0 commit comments

Comments
 (0)