Medium
,Array
,Hash Table
,Matrix
,Simulation
2352. Equal Row and Column Pairs
Given a 0-indexed n x n
integer matrix grid
, return the number of pairs (ri, cj)
such that row ri
and column cj
are equal.
A row and column pair is considered equal if they contain the same elements in the same order (i.e., an equal array).
Example 1:
Example 2:
Constraints:
grid[i][j]
<= 105Yen-Chi ChenWed, Jun 14, 2023
SheepWed, Jun 14, 2023
JimJun 14, 2023