🧠 Before you code — what pattern fits?
Given an n x n integer matrix grid, return the number of pairs (rᵢ, cⱼ) such that row rᵢ and column cⱼ are equal (contain the same elements in the same order).
[[3,2,1],[1,7,6],[2,7,7]] → 1
🎬 Video explanation · codestorywithMIK
Your solution runs against 2 unit tests, including edge and large-value cases.
Loading...
Test console · 2 unit tests
Submit your code to run it against all 2 unit tests. Results appear here.
JavaScript, TypeScript & Python run sandboxed in your browser; other languages run on the execution server. Your code is saved locally as you type.