#2352 - Equal Row and Column Pairs
Given a 0-indexed n × n integer matrix grid, return the number of pairs (ri, cj) such that row i and column j are equal (same elements in the same order).
| Input | Output |
|---|---|
grid = [[3,2,1],[1,7,6],[2,7,7]] | 1 |
grid = [[3,1,2,2],[1,4,4,5],[2,4,2,2],[2,4,2,2]] | 3 |