Dsa
Matrix
Warm-up
Count Odd Numbers in Matrix
Given a matrix of integers, count how many of those numbers are odd. The input consists of two integers m and n (the dimensions of the matrix) followed by m lines of space-separated integers representing the matrix. Output the count of odd numbers.
Example:
Input:
2 3
1 2 3
4 5 6
Output:
3
Key concepts
matrixcountodd
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