give 0indexed n x n integer matrix grid return number pair Ri Cj row Ri column Cj equalA row column pair consider equal contain element order ie equal array Example 1input grid 321176277output 1explanation there 1 equal row column pair row 2 Column 1 277example 2input grid 3122144524222422output 3explanation there 3 equal row column pair row 0 Column 0 3122 row 2 Column 2 2422 row 3 Column 2 2422 Constraintsn gridlength gridilength1 n 2001 gridij 105