Question bank › Matrix
Dsa Matrix Easy

Identical Rows Count

Count the number of rows in a matrix that are identical to one another. Two rows are considered identical if all corresponding elements are the same. Input Format: The first line contains two integers M and N, the number of rows and columns. The next M lines each contain N integers representing the elements of the matrix. Output Format: Print an integer representing the count of identical rows. Example: Input: 3 4 1 2 3 4 1 2 3 4 5 6 7 8 Output: 2

Key concepts

matrixcounthashing

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.