Skip to content

Commit 1d5760f

Browse files
committed
Runtime: 218 ms (Top 37.41%) | Memory: 52 MB (Top 63.08%)
1 parent 690a85f commit 1d5760f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1+
// Runtime: 218 ms (Top 37.41%) | Memory: 52 MB (Top 63.08%)
12
var equalPairs = function(grid) {
23
let n = grid.length
34
let count = 0;
4-
5+
56
let map = new Map()
6-
7+
78
//making rowArray
89
for(let row = 0; row < n; row++){
910
let temp = []
1011
for(let col = 0; col < n; col++){
1112
temp.push(grid[row][col])
1213
}
13-
14+
1415
temp = temp.join()
1516

1617
if(map.has(temp)){
@@ -21,20 +22,19 @@ var equalPairs = function(grid) {
2122
map.set(temp, 1)
2223
}
2324
}
24-
25-
25+
2626
for(let col = 0; col < n; col++){
2727
let temp = []
2828
for(let row = 0; row < n; row++){
2929
temp.push(grid[row][col])
3030
}
31-
31+
3232
temp = temp.join()
3333

3434
if(map.has(temp)){
3535
count += map.get(temp)
3636
}
3737
}
38-
38+
3939
return count;
40-
};
40+
};

0 commit comments

Comments
 (0)